Romania's Parliament has approved a new spy chief opposed by the prime minister, dealing a blow to the leader who faces increasing pressure to resign amid a corruption investigation.

The vote was a major test for Prime Minister Victor Ponta, who is recovering from knee surgery in Turkey.

Ponta opposed the nominee, Mihai Razvan Ungureanu, who was proposed by Ponta's political rival, President Klaus Iohannis.

Ruling party lawmakers boycotted the session. Ungureanu was approved in a 278-6 vote on Tuesday, with the help of parties which had been previously allied to Ponta, to head the Foreign Intelligence Service — a post Ungureanu has already held.

Ponta is the subject of a money laundering, forgery and conflict of interest case while he was a lawyer in 2007-2008. He denies wrongdoing.