The embassy, located in Holland Park in west London, said the official car of the Ambassador of Ukraine to the UK, Natalia Galibarenko, was attacked on Saturday morning at around 10am.
Scotland Yard said a vehicle was driven at police officers when they arrived at the scene.
Police firearms and Taser were discharged, the vehicle was stopped and a man, aged in his 40s, was arrested, the Metropolitan Police said.
The man, who was not injured, has been taken to a central London hospital as a precaution.
Police said both armed and unarmed officers were deployed to the incident “as part of the protective security arrangements for London”.
The Met said officers were called at approximately 8.30am to reports of a car in collision with a number of parked vehicles near the Ukrainian embassy.
The incident is not being treated as terrorist-related.
A statement from the Ukrainian embassy said: “Around 10am on Saturday 13 April, the official vehicle of the Ambassador of Ukraine to the United Kingdom was deliberately rammed as it sat parked in front of the Embassy of Ukraine’s building.
“The police were called immediately, and the suspect’s vehicle was blocked up.
“Nevertheless, despite the police actions, the attacker hit the Ambassador’s car again.
“In response, the police were forced to open fire on the perpetrator’s vehicle.
“The culprit was apprehended and taken to a police station. No one of the Embassy staff were injured.
“The police are investigating the suspect’s identity and motive for the attack.”
A woman who works at a nearby shop said she heard shots fired twice.
The woman, who did not wish to be named, said officers arrived “very quick”, adding: “I saw many police cars coming.”
A silver car outside the embassy was the subject of a forensic officer’s investigation on Saturday afternoon.
The vehicle, which a police source said was a Mercedes, appeared to have been backed into the black car.
The black vehicle was heavily scuffed on its right-hand side.
The silver vehicle’s rear right indicator was flashing and its boot and driver’s door were open.
Chief Superintendent Andy Walker, from the Met’s Specialist Firearms Command, said: “As is standard procedure, an investigation is now ongoing into the discharge of a police firearm during this incident.
“While this takes place, I would like to pay tribute to the officers involved this morning who responded swiftly to this incident and put themselves in harm’s way, as they do every day, to keep the people of London safe.”
The Met said the Directorate of Professional Standards has been informed.