Unemployed Ali Mustafa Rahimi, of Hastings Road, threw an explosive at the building’s wooden doors on September 22.
He pleaded guilty to the crime, at Southwark Crown Court on Friday.
The blaze from the petrol bomb did not fully ignite but still caused £3,000 worth of damage to the embassy in Princess Gate, Kensington. It could have killed or injured scores of people but diplomatic protection officers arrived within minutes and the blaze was contained shortly after.
Rahimi was identified through CCTV footage in a joint investigation by the British diplomatic protection police, counter terrorism officers and the Ministry of Defense Police.
He was charged with arson and intent to endanger life and will be sentenced on January 27.
Chief Inspector Steve Marshall of Diplomatic Protection Group Operations, said, “This was a clear and determined attack on the embassy which endangered the lives of those working inside.”