Image copyright AP Image caption Turkish policeman Mevlut Mert Altintas photographed immediately after shooting Russian ambassador Andrei Karlov on Monday

When an assassination takes place, it is rare to find a professional news photographer on the scene, capturing the act and the killer's expression just seconds afterwards.

But when Russian ambassador Andrei Karlov was killed by a Turkish policeman in Ankara on Monday, Associated Press photographer Burhan Ozbilici was unexpectedly in the front row.

Ozbilici took images in the Ankara art gallery while the killer was shouting wildly and waving a gun in the air.

"I was, of course, fearful and knew of the danger if the gunman turned toward me," Ozbilici wrote on a widely shared blog, posted by AP after the incident.

He also wrote of watching a life that "disappeared before my eyes".

Warning: Graphic images follow

Image copyright AP Image caption Andrei Karlov started his speech as his soon-to-be-assassin stood behind him

Karlov was speaking at the opening of a photography exhibition when he was shot dead by Mevlut Mert Altintas.

Ozbilici had popped in to the event as it was on his way home from the news agency's office.

In the blog, he said he anticipated it would be routine job that would be a chance to get some stock pictures to illustrate Turkish-Russian relations.

Instead, he wrote, he became an eyewitness to a murder and the ensuing "pandemonium".

Image copyright AP Image caption Mevlut Mert Altintas shot Andrei Karlov, and then yelled as the body lay beside him

Image copyright AP Image caption Ozbilici also photographed witnesses in the immediate aftermath

Witnesses rushed for cover as Altintas, a 22-year-old member of Ankara's riot police, paced around the body of his victim.

He shouted in Turkish and Arabic about the Syrian war, in which Russia has become a key player as a Syrian government ally.

Ozbilici wrote: "People screamed, hid behind columns and under tables and lay on the floor. I was afraid and confused, but found partial cover behind a wall and did my job: taking photographs."

Media playback is unsupported on your device Media caption Associated Press photographer Burhan Ozbilici interviewed by the BBC's Newshour

Image copyright AP Image caption There was panic as exhibition attendees sought to leave the scene

He said he recognised the danger of moving towards the gunman as others ran away, but he felt he had to capture the scene.

His actions were recognised by others on social media.

"Photographers are often the first writers of history," wrote UK journalist Simon Ricketts on Twitter, after sharing the blog.

"In awe of my brave AP colleague Burhan Ozbilici," tweeted an AP director, Kristin Gazlay.

Ozbilici also captured chilling shots of the incident's build-up, when the victim and the rest of the room were oblivious to what was about to unfold.

"When I returned to the office to edit my photos, I was shocked to see that the shooter was actually standing behind the ambassador as he spoke. Like a friend, or a bodyguard," he wrote.

Altintas was shot dead at the scene of the crime by Turkish police.