Israeli Prime Minister Yitzhak Rabin announced his withdrawal from politics tonight because of a scandal involving an illegal bank account he and his wife held in Washington.

Under Israeli law, Rabin cannot resign as prime minister until next month's general election, but in a radio and television interview he said he is withdrawing his candidacy for Parliament and considering what, if anything, he can do to terminate his responsibilities in the present government.

The surprise announcement, less than six weeks before the election, leaves Israeal's already turbulent political scene in turmoil.

Observers here expect the ruling Labor Party to turn now to Defense Minister Shimon Peres, whom Rabin narrowly defeated at the party's convention in February.

It is uncertain now, however, whether Rabin will have to remain as a figurehead prime minister until the elections.

The Labor Party, which has ruled Israel since independence in 1948, was already plagued with scandals and accusations of corruption, and it is likely that Rabin's sudden resignation involving financial impropriety will further hurt Labor's fortunes at the polls.

The first indication of the scandal that now appears to have ended Rabin's political career came to light last month when a reporter for an Israeli paper learned that Rabin's wife, Leah, held a U.S. dollar account in the National Bank of Washington left over from 1973 when Rabin ended his term as ambassador to the United States. It is illegal for Israeli citizens to hold foreign bank accounts.

Leah Rabin readily admitted this but allowed it to be said that the amount involved did not exceed $2,000. The Prime Minister later announced that he shared the responsibility for the account and asked the Ministry of Finance to investigate. He offered to pay a fine.

Given the small amount involved, and the Prime Minister's frankness over what seemed little more than a technical violation, the public and press tended to play down the affair and it did not become a major campaign issue.

But the bank transcripts that were handed over to the Ministry of Finance, by Rabin's lawyer about 10 days ago showed major discrepanices between the facts and what Rabin and his wife had said. There were actually two accounts amounting to a total of $18,000 when the Rabins left Washington in 1973 and about $10,000 remaining when the story broke last month during Rabin's official visit to Washington.

A committee made up of several government ministries who usually deal with such cases had originally decided to ask the Rabins to pay a penalty of about $15,000, which would have ended the matter. But the government's legal adviser, Aharon Barak decided that in the case of Mrs. Rabin a fll criminal investigation by the police was warranted.

Israeli newspapers learned last night that the Rabin bank account exceeded the amount originally admitted to by the Prime Minister's office and that the legal adviser was being consulted.

Tonight, in his announcement resigning his candidacy, Rabin admitted to holding the larger amount in the Washington bank and said he was not "hiding the fact that it was a mistake. It was negligence that we did not close the account in the time allotted after the termination of my office (as ambassador)."

Announcing that his wife was to be the subject of a criminal investigation, Rabin said, "I could not accept that because I feel the formal responsibility is a joint responsibility and, if my wife is to be investigated, I will not hide behind parliamentary immunity."

Rabin added that he did not try to hide the fact of his joint bank account and that he had done everything he could to rectify his mistake within the law.

But, he said that the issue might "precent the Labor Party from receiving the maximum number of votes that I think it deserves." Therefore, he said, he was withdrawing as his party's candidate for prime minister and considering "what I can do to wind up my respobsibility in the interim government."

In a dignified and somber manner, Rabin wrote his won political obituary tonight. "I permit myself to say that this is a sad ending to my public career," he said. "I am very sorry that a matter which in my eye is secondary shoule have caused this. I feel that by and large I have been successful in the three main tasks which I was given.

"As chief of staff it was my responsibility to prepare the Israeli army for the challenge it had to face during the Six Day War in 1967 and I think I did so admirably.

"As ambassador in Washington (1968-73) I helped to forge an alliance between Israel and the United States which enhanced Israel's international position.

"As Prime Minister, I succeeded to a large extent in taking Israel out of the doldrums following the Yom Kippur war."

Having served as a professional soldier most of his working life, Rabin came to politics late in life deciding to run for Parliament in 1973 after his tour as ambassador. Long a protege first of Prime Minister Levi Eshkol and then of Prime Minister Golda Meir, when Labor was looking around for a fresh political face after the October 1973 party turned to Rabin to head its list. He became Prime Minister in June 1974.

His strengths as a soldier, diplomat and Prime Minister were considered to include an analytical mind, courage of decision which was often interpreted as stubbornness and a bluff frankness of expression.

His weakness was an inability to form a team with in his government and an introverted moodiness that seehed to suit him poorly for the shove and push of Israeli politics.

The last few months of his term were marred by a declining economic situation, a series of debilitating strikes, and a number of inancial scandals involving important figures in the labor party.

Rabin's announcement came as Israelis were dancing in the streets of Tel Aviv and blowing horns in Jerusalem over the upset victory of Israel's basketball team in the European Cup competition held in Belgrade tonight.

After Rabin's dramatic announcement late in the evening, most political parties quickly called urgent meeting of their governing body for Friday morning to discuss the new situation Rabin's own Labor Party will have the most difficult decision to make. There are only four days left before the parties must submit their final list of candidates to the central election committee.

While it is almost certain that Shimon Peres will be the party's choice, the left wing of the party may try to get Rabin to change his mind.

The present political crisis comes as the situation on Israel's Lebanon border is deteriorating. The Israeli government may have to make crucial decisions about Israel's response to the recent setbacks of Israel's Lebanese Christain allies that at the hands of the Palestinians.