JERUSALEM — Exit polls show that Israeli Prime Minister Benjamin Netanyahu’s Likud Party and his hard-line allies have won a narrow majority in parliamentary elections.

In an election on Tuesday far closer than polls forecast, Netanyahu’s Likud Party captured just 31 seats, well below expectations. But with his hard-line and religious allies, he would still be able to form a narrow majority in the 120-seat parliament, according to the exit polls.

In the biggest surprise, the centrist “Yesh Atid,” party headed by political newcomer Yair Lapid captured as many as 19 seats, well above the forecasts. That would position Lapid to become either opposition leader or seek a major Cabinet post if he decides to join Netanyahu’s governing coalition.

Netanyahu’s campaign manager, Gideon Saar, says he hopes to form a broad coalition.