(Adds details, background)
TRIPOLI, Sept 12 (Reuters) - Libya's national congress has picked Mustafa Abu Shagour, the current deputy prime minister, as the North African country's next prime minister, a live televised vote showed on Wednesday.
Abu Shagour won 96 votes against war-time rebel prime minister Mahmoud Jibril's 94 votes in a close second round run-off conducted by the 200-member assembly which was elected in July.
Jibril had led the count in a first round of voting with 86 votes against Abu Shagour's 55 votes.
Abu Shagour, a respected optical engineer, carved out a career as an academic in the United States before returning to Libya last year where he was an adviser to the now dissolved National Transitional Council.
He was appointed a deputy to Prime Minister Abdurrahim El-Keib in November.
In an interview with Reuters last month, Abu Shagour said that getting a grip on security, in an often anarchic Libya after the toppling of Muammar Gaddafi, would be the priority for Libya's new rulers.
His election comes after the U.S. ambassador to Libya and three embassy staff were killed in an attack on the Benghazi consulate and a safe house refuge, stormed by Islamist gunmen blaming America for a film they said insulted the Prophet Mohammad. (Reporting by Ali Shuaib and Marie-Louise Gumuchian; Editing by Alison Williams)