JERUSALEM (AP) _ Prime Minister Yitzhak Shamir's right-wing Likud bloc today demanded that Pope John Paul II cancel his invitation to Kurt Waldheim because of the Austrian president's alleged Nazi past.

''You should admit your mistake and change your mind,'' Likud spokesman Ronit Ekstein quoted a telegram sent to the pope as saying. ''This is a true test of your moral mission.... Hundreds of millions of people in the world are watching you and expecting this of you.''

The June 25 meeting with the Pope at the Vatican will be Waldheim's first official state visit since he was elected to the presidency last June.

Rome's Jewish leaders today also sent a telegram to the pope protesting the meeting.

''The Jews of Rome, having learned with vivid regret the news of Waldheim's visit to the Vatican, express their disillusionment and protest,'' said the telegram. It was sent by Elio Toaff, chief rabbi of Rome, and Giacomo Saban, president of the city's Jewish community of 16,000.

''The noble speech to the Jews of Warsaw is gravely contradicted by granting a visit to a person compromised with the Nazi regime and seriously suspected of crimes against the civilian population and the Jewish community,'' the telegram said.

The pope met with representatives of Warsaw's surviving Jewish community during his visit to Poland earlier this month.

Waldheim has been accused of direct involvement in Nazi atrocities in the Balkans during World War II. He has denied any wrongdoing but has admitted lying about his whereabouts during the latter part of the war.

Waldheim was barred from entering the United States because of the allegations against him. Other countries have refused to allow him to visit.

On Thursday, the Israeli government condemned the papal decision.

It ''surprised the Jewish world and the state of Israel. We wonder what were its motives, and we condemn the decision,'' said Foreign Ministry spokesman Ehud Gol.

American Jewish leaders also have sharply criticized the move.

Israel Singer, secretary of the World Jewish Congress, told Israel Radio Friday: ''The visit will spoil not only the image of the Pope and the Vatican but also all of those links he said he wanted to build with the Jewish people.''