Belgian Prime Minister Wilfried Martens submitted the resignation of the government to King Baudouin today, but the king refused the offer. Martens said his present coalition would stay in office and early elections would be held in October.

Martens made the offer after one of the four parties in his center-right government decided to withdraw in protest over the refusal of the interior minister to take responsibility for the May 29 soccer riot in Brussels, in which 38 people were killed.

The king acted after consulting Martens and other political leaders.

"The government will go ahead in a restricted period of time with a minimum program," Martens said, and general elections set for December would be held in October.

The French-speaking Liberal Reform Party withdrew from the government coalition yesterday, saying it could only remain in the government under "honorable conditions." This was taken to mean the resignation of the interior minister, Charles-Ferdinand Nothomb.

A Belgian parliamentary commission of inquiry into the violence at the European Cup championship concluded that English fans of the Liverpool team were primarily to blame. The fans attacked supporters of the Italian team Juventus, causing a panic in which many of the Italians were trampled.

The inquiry also said that there were serious errors in the security preparations for which Nothomb should bear responsibility, but he has refused to resign.

Although the king has little say in the daily running of the government, he plays a key mediating role during the country's frequent leadership crises.

Martens' spokesman said it would have been "technically impossible" for the king to have accepted the resignation now, dissolved parliament and called new elections. The elections must be held within 40 days, he said, which meant they would have come during August, when much of the country is on vacation.

The king's responsibilities for mediation have been complicated by the increasingly strong divisions between Belgium's Flemish- and French-speaking communities, that have resulted in the creation of separate regional parties representing the left, center and right.

Despite the linguistic strains, Martens' current coalition, formed in December 1981, has come close to setting a record for longevity among the 32 governments that have ruled postwar Belgium. He led four other governments between 1979 and 1981 before putting together a more durable team.

The frequency of change has led to the use of shorthand by Belgian newspapers, that refer to the government by the name of the prime minister and a Roman numeral signifying the number of coalitions he has led. The present government is known as "Martens V."

Martens' government has survived several serious political challenges, including the implementation of an unpopular economic austerity program in 1983 and the deployment by NATO of nuclear cruise missiles in March.

But in the view of some of his political aides, the durability of Martens' government has itself created the conditions for political maneuvering by the coalition partners, each nervously jockeying for advantage in the preelection period