(Adds poll in paragraph 11)
By Dan Williams
JERUSALEM, July 23 (Reuters) - Israeli Prime Minister Benjamin Netanyahu said he was "doing excellently" after an unscheduled pacemaker implant and would on Monday attend a key judicial reform vote that has brought nationwide protests to a boil and stirred calls for compromise.
With the country ensnared in its worst domestic crisis in decades, President Isaac Herzog on Sunday met Netanyahu in the hospital treating him in hope of closing the rifts between the religious-nationalist ruling coalition and opposition parties.
"This is an emergency. Agreement must be reached," Herzog, who mediated fruitless March-June talks, said in a statement.
The Knesset, where Netanyahu wields a comfortable majority, is due on Monday to hold final readings of a bill limiting Supreme Court powers to overrule some government decisions.
It would be the first reform written into law of a package critics fear aims to curb judicial independence, but which Netanyahu - who is on trial on corruption charges he denies - insists are needed for balance among branches of government.
The embattled 73-year-old leader was rushed to a hospital near Tel Aviv late on Saturday after a heart monitor implanted a week earlier in what was described as a dehydration episode detected a "temporary arrhythmia", his doctors said.
Fitted with a pacemaker, he was due for discharge on Monday.
"As you can see, I am doing excellently," he said in a video statement that showed him seated, smiling and wearing a blazer.
"We are pursuing efforts to complete the legislation, as well as efforts to do this through consensus, but in any event I want you to know that tomorrow morning I'll be joining my colleagues in the Knesset."
Lawmakers on Sunday began debating the bill, which would amend a law enabling the Supreme Court to void decisions made by the government and ministers it deems "unreasonable".
Poll results aired by national broadcaster Kan found that 46% of Israelis were opposed to the amendment versus 35% who were in favour and 19% who were undecided.
The Histadrut labour federation proposed a scaled-down version of the bill. Centrist opposition leader Yair Lapid said that could be a basis for new compromise talks, but Netanyahu's Likud party said it was too close to Lapid's positions.
RIVAL RALLIES
Tens of thousands of Israelis calling for the proposed judicial overhaul to be scrapped lined city streets in Jerusalem carrying flags and beating drums under a scorching summer sun. Many pitched tents in a park near the Knesset.