The Libyan rebels' chief of army staff, Abdel Fatah Younis, has been killed in an assassination by pro-Gaddafi agents, according to the rebel authorities.

The president of the ruling National Transitional Council, Abdul Mustafa Jalil, made the dramatic announcement of the death of Younis at a chaotic late-night press conference at a hotel in Benghazi.

He told reporters that Younis had been called back from the frontline near Brega to Benghazi for questioning on the progress of the campaign, and suggested he had been killed by "pro-Gaddafi" forces on the route early in the morning.

But questions remain over the lack of detail over how Younis died or who killed him. The general usually travels inside an armoured car in a multi-vehicle convoy with 30 armed guards, posing problems for any potential assassination team.

Jalil said two senior rebel officers were killed alongside Younis, and demanded that what he called pro-Gaddafi elements he said were operating in Benghazi surrender or join the rebel forces.

The shock announcement came after a day of heated speculation that Younis had been arrested on the orders of Jalil. Younis was Gaddafi's former interior minister until he dramatically changed sides to join the revolution in February.

The rumours were still swirling late on Thursday night, with armed men declaring their support for Younis appearing on the streets of Benghazi, claiming they would use force to free him from NTC custody.

Soldiers loyal to Jalil from the 17 Brigade, Benghazi's elite unit, had surrounded Younis's house in the late afternoon.

Then in the evening, Jalil said at the press conference that "with regret" he had to announce the death of general Younis. Jalil called him "one of the heroes of the 17th of February revolution".

Minutes later, gunfire broke out in the street outside the Benghazi hotel where the announcement was made, with machine gun bullets smashing windows.

The press conference, which ended abruptly with the NTC president refusing to take questions, failed to explain how the general could have been ambushed in a highly guarded convoy.

Younis has been a controversial figure as head of the rebel forces because – until the uprising – he was Muammar Gaddafi's Interior Minister, one of his most trusted officials and confidants. The general's friendship with Gaddafi dated from 1969 when he joined a group of fresh-faced army officers in deposing Libya's king.

But when riots came to the streets of Benghazi in February, he dramatically switched sides, joining the rebels and bringing the city's interior ministry military brigade with him.

That brigade was crucial in helping the under-armed rebels fight off the attacks by regime forces in the first days of the fighting, and command of this unit is believed to have been the key to the decision of rebel leaders in appointing him army commander.

But his tenure as commander was stormy: he reportedly nearly came to blows with his rival for the army command, Klalifa Hefter, during a meeting in late March.

For much of that month both men claimed to be in command of the ragtag rebel forces as they raced west towards Tripoli, only to be thrown back towards Benghazi in chaos and confusion.

By April, Younis had won the political battle inside the National Transitional Council and was confirmed as chief of staff but he failed to use his new position to bring victory on the battlefield.

Since April, the frontline has remained largely in stalemate, despite heavy Nato bombing of government forces around the key oil town of Brega.

Younis launched an attack on Brega in June, only to see it beaten back.

Two weeks ago, aided by some of the heaviest Nato tactical bombing of the war, he tried again, with a three-pronged attack on the town.

Rebel military spokesmen repeatedly insisted that Brega was on the point of falling but, after a fortnight of fighting, the town remains in government hands.

The rebels in the besieged city of Misrata have conspicuously refused to accept orders from Younis, to the extent of insisting that their fighters are not part of the Benghazi-controlled National Army.

Many rebels were shocked by the news of the killing. "We respect him because he left Gaddafi; when he left a lot of colonels saw what Younis did and they defected also," said Farouk Ben Ahmeda, a rebel fighter in Misrata.

But few think that his military skills will be irreplaceable.

"I don't think that he was really a professional soldier; he didn't command the soldiers well," said Ben Ahmeda.

The assassination will cause embarrassment and concern for the Foreign Office in the UK, as it comes just a day after the foreign secretary, William Hague, said that Britain would recognise the NTC as the legitimate government of Libya and expelling Gaddafi's diplomats.

London had hoped that after months of work, the NTC was now fit to govern. Unless Jalil can provide a full and public account of the assassination and the circumstances around it, that opinion may need to be revised.