Venezuelan officials say several people have been killed in a police operation to arrest a fugitive ex-officer who stole a police helicopter and attacked government buildings six months ago.

A former elite police officer and a pilot, Oscar Perez has been on the run since June 2017 when he and several unidentified accomplices used the aircraft to throw four grenades at the Supreme Tribunal in the capital Caracas, before shooting at the interior ministry with firearms.

There were no casualties as a result of that attack.

On Monday, Perez posted several videos of himself online showing injuries from a clash between him, several of his allies and an elite Venezuelan police force on the outskirts of Caracas.

In the footage posted on his Instagram account, Perez said he and his companions were surrounded and pinned down by police marksmen on a roadway at El Junquito.

Perez can be seen hunched down, with blood on his face and a machine gun in hands. In some of the videos, shots can be heard.

"They are firing at us with grenade launchers. We said we are going to surrender, but they do not want to let us surrender. They want to kill us," a bloodied Perez said.

However, Venezuela's interior ministry said police forces came under attack by Perez's group as they were negotiating a surrender.

It said in a statement that Perez's group had "tried to detonate a vehicle loaded with explosives", adding that at least two police officers and an unspecified number of the former officer's companions died during the battle.

Five people were captured, the ministry added, although the fate of Perez was unknown.

"These terrorists, who were heavily armed with high-calibre weapons, opened fire on the officials responsible for their capture," the ministry said

In several videos posted after the helicopter attack in June, Perez had declared that he belonged to an uprising of members of the security forces who were fed up with President Nicolas Maduro's administration.

The Venezuelan authorities later issued an arrest warrant in which he was accused of a "terrorist attack".