The most serious political crisis of Israel's 19-month-old coalition government appeared to have evaporated today as Prime Minister Shimon Peres agreed to allow the rebellious finance minister, Yitzhak Modai, to trade jobs with Foreign Minister Yitzhak Shamir for the next six months.

The unusual compromise averted an expected showdown Sunday between the Labor Party and Likud bloc Cabinet ministers that could have brought down the government and forced early parliamentary elections.

Shamir has no experience in finance, and Modai has none in foreign affairs, but the architects of the compromise said that the alternative was a bitter election campaign that would have scuttled Israel's economic recovery efforts and set back prospects for a negotiated Middle East peace agreement.

However, the actual swap of portfolios will be delayed for at least two weeks because Shamir is scheduled to make a visit to South America. The ministers scheduled another meeting Saturday to hammer out the final details of the compromise.

The crisis erupted last week when Peres was visiting the United States and Modai, in two newspaper interviews, accused the prime minister of squandering money on Labor Party-affiliated enterprises and of engaging in a "cynical game with the resources of the state." Modai also criticized Peres' travels, calling him a "flying prime minister."

Peres demanded Modai's resignation and threatened to fire him. In a surprise move, Modai on Wednesday announced that he was resigning in what appeared to be a tactical move signaling the Likud bloc to threaten to bring the government down.

There was still some opposition to the compromise within the Likud caucus of the Knesset, or parliament, because Peres insisted that Modai not be allowed to regain the Finance Ministry portfolio after Peres yields the premiership to Shamir on Oct. 25 under the coalition's rotation agreement. Peres has indicated that he would like to take the finance minister's post himself, even though under the rotation agreement he has been promised the Foreign Ministry portfolio after Oct. 25.

The compromise is to be presented to the Cabinet on Sunday for approval, then to the Knesset for ratification.

Labor Party officials appeared satisfied that the crisis -- the latest of at least a half dozen that have threatened the government in the last year -- has been resolved, thereby avoiding early elections and the likelihood of another inconclusive outcome and fresh coalition bargaining.

Education Minister Yitzhak Navon said, "We thought if a minister Modai violated the fundamental rules of government, he should not be in the Cabinet. But as I understood it, it would have caused a real crisis. So, under the circumstances, that's a good solution."

Navon added, "I think the rotation is there. It is going to take place . . . I think the public would like to have a stable government and give a chance to this government until the end of its term."

Shamir said that he expects to gain valuable experience in finance in the next six months before he rotates into the post of prime minister.

Peres, according to Labor Party strategists, set his sights on the finance portfolio partly because his future in the Foreign Ministry did not look promising with Shamir directing foreign policy from the prime minister's office, and partly because of the vast patronage that the Finance Ministry offers.

However, Israeli political analysts noted that the vast ideological gulf between the two men virtually assures contention -- and future coalition crises -- after the scheduled rotation takes place.

Still standing in the way of formal Knesset approval of the compromise agreement is Deputy Prime Minister David Levy, who has aspirations of his own and who wields considerable influence within Likud. Levy has said he is opposed to the Modai-Shamir portfolio swap unless there are guarantees that a Likud minister is given the Finance Ministry after the Oct. 25 rotation.