Thousands of workers and students angry over hefty price increases ordered by the government yesterday demonstrated in Cairo and other cities today in Egypt's worst unrest in at least two years.

Much of downtown Cairo was paralyzed in the evening rush hour as demonstrators milled about chanting slogans against the government and President Anwar Sadat. Such demonstrations are unusual in Egypt, where public opinion and protest are closely controlled.

Police said protesters set fire to two police stations in the old quarter of Cairo. Riot police formed roadblocks outside Cabinet ministries and other government offices. Tear gas was used in an unsuccessful attempt to disperse a mob near the Arab League headquarters.

(About 400 demonstrators were arrested, Associated Press said, and police reported most of Cairo calm by midnight).

Reports from Alexandria, 130 miles north of here, said troops were used to control thousands who marched in disorders there.

(Agence France-Presse reported that protesters invaded the Alexandria home of Vice President Hosni Mubarak, dragging items from the house and burning them.

(The official Middle East News Agency said tonight that the government is prepared to reconsider the price increase, AFP reported. The Middle East News Agency quoted Fuad Mohieddin, minister of state for parliamentary affairs, as saying that the government was willing to make "and objective reexamination" of the price increases in order to "spare the working classes.")

Despite the scattered violence, the demonstrations appeared to be generally peaceful and could not be called riots. Most of the protesters merely marched and chanted.

Nonetheless, the demonstrations represent exactly the kind of potential threat to the country's stability that the Sadat government feared. But it was under international pressures to increase the long-subsidized prices of food and other staples and to implement an austerity program.

The impact of yesterday's move was severe, raising the prices of wheat, flour, soap, rice, butane cooking gas, some textiles, cigarettes and gasoline by as much as 31 per cent.

The International Monetary Fund, Western bankers and businessmen and foreign nations that give aid to Egypt, including some Arab states, had been urging Egypt to reduce its subsidies of commodities and cut government spending as steps toward a solution of its staggering economic problems.

Faced with a potential deficit of nearly $2 billion in its new $10.16 billion budget, the government acted strongly.

By reducing government subsidies and increasing taxes and customs duties, the government in effect raised the prices of most staples. Taxi fares and the cost of electrical appliances also went up, as did the prices of imported luxuries such as automobiles and whiskey.

While some government workers will get salary increases of up to 22 per cent, the overall impact of a population already squeezed by inflation and poverty is heavy.

Demonstrations were organized in the port city of Alexandria shortly after the news was published in the Egyptian press this morning.

This afternoon, public transit service to Cairo's industrial suburb of Helwan, site of some of the country's biggest manufacturing plants, was cut off as workers demonstrated there. Some cars were reported stoned on the Cairo-Helwan road, which passes through the luxury suburb of Maadi.

Crowds of students gathered around Egypt's Parliament to shout disapproval of the government's program. They chanted "Sayed Marei, millionaire," a reference to the wealth of the Parliament's speaker, and "down with Sadat."

It was difficult to estimate the number of demonstrations because spectators quickly filled the streets around them. Police using tear gas, riot shields and batons drove the crowd away after about an hour, but the demonstrations regrouped in larger numbers a few blocks away, on the city's main downtown square near the Hilton Hotel.

Later they moved up into the city's shopping and entertainment area. Police, who kept them away from government buildings, appeared to be showing restraint, which experienced observers said indicated that the authorities expect the demonstration to wear itself out.

Dr. Abdel Moneim Kaissouni, deputy prime minister for financial and economic affairs, issued a statement saying that the austerity measures were necessary now to ward off even more unpleasant moves later on. This reflects Sadat's position that it will take some years for his so-called open door economic policy to bring prosperity and in the meantime all Egyptians face further hard times.

Sadat is in Aswan, the winter resort town 600 miles south of Cairo, awaiting the arrival Thursday of Yugoslav President Tito. Because of the death in a plane crash today of Yugoslav Premier Dzemal Bijedic, however, it was not certain that Tito would come to Egypt.