President Ferdinand E. Marcos hinted in a tough statement today that he may reimpose martial law after a burst of rioting last night between youths and police left at least 10 persons dead.

"I warn the opposition, do not force my hand," Marcos declared in a television appearance this morning. "Do not compel me to move into extremes that you already know of. If necessary I will do so."

Last night's confrontation had followed a peaceful rally where opposition leaders repeatedly called on Marcos to resign.

It was the most serious violence to grow out of a series of antigovernment demonstrations that have erupted since a leading Marcos foe, Benigno S. Aquino Jr., was murdered one month ago. Many in the opposition believe someone in the Marcos government ordered Aquino killed.

Marcos today did not specifically mention martial law, but the message seemed clear in the brief, stern statement he read on national television.

"You misread our capability if you think that one night's rioting is going to deter us," he told the opposition, which had repeatedly called on him to step down.

Marcos imposed martial law in 1972 and lifted it in January 1981, but he has retained some of the emergency powers it had provided.

After yesterday's peaceful rally, in which anti-American slogans were featured, several thousand students broke away from the huge crowd and marched on the palace, hurling rocks, bottles and small home-made explosives against a police line that at first fell back toward the palace gates.

More soldiers and police were rushed in. They pushed the students back with shields, clubs, buses, water hoses and gunfire. Scattered fighting went on for two hours.

The students burned two police buses used as barricades and left mounds of burning debris lying in the streets.

The main clash occurred near a bridge that is remembered as the site of another battle with government troops in 1972. The reinforced police line waited for some time behind shields and barricades as the young attackers showered it with small explosives known as "pillboxes." Then the police and soldiers counterattacked using clubs, guns and small explosives of their own. Gunfire erupted on two occasions.

During the day, police had been on the streets unarmed in compliance with government instructions to use caution. The military had warned that the rally would be infiltrated by radicals. One fireman and several civilians died of gunshot wounds, according to hospital officials, and the official Philippine News Agency reported that another fireman and a marine corporal were killed by explosions.

In an interview on ABC's "Nightline," Marcos denied that police had fired on demonstrators. When asked about the possibility of declaring martial law he said, "I might if I am compelled to do so," adding, "It is not necessary right now."

After the main battle ceased, there were sporadic incidents in several parts of Manila. Piles of debris and rubber tires were found burning on downtown streets. A nonviolent protest was held in the financial district in suburban Makati.

The afternoon rally drew one of the largest crowds in the history of anti-Marcos protests here, perhaps exceeded only by the one that accompanied the funeral of Aquino. Estimates of its size ranged from 100,000 to 500,000.

It was led by Aquino's widow, Corazon, who recited a pledge of continued struggle against Marcos. It was recited back by the crowd that overflowed a central Manila plaza less than a mile from the presidential palace. The crowd listened for four hours in stifling heat to their leaders, who demanded that the president resign and who called for the memory of Aquino to be kept alive.

"I will not allow fear to stop me," Corazon Aquino told the crowd. "Regardless of the cost I will defend freedom."

At noon, with the opposition visibly building in the nearby streets, Marcos went on national television and said he was more "saddened than angered" by the demonstration. He said such discord would jeopardize the country's economic stability, and then outlined a 10-point program of economic measures he said "will lighten the burden on the private sector."

Marcos promised to cancel planned increases in social security premiums, "discourage" college tuition increases, and reduce government intrusion in private business.

The measures were the latest of several attempts by Marcos to defuse the opposition, which has used Aquino's death to mobilize many new supporters against the president. Aquino was the major political threat to Marcos and there is a widespread belief here that someone in his government ordered him killed.

A series of recent protests have demanded resignation of Marcos but yesterday he repeated his refusal to step down. Anti-American signs were prominently displayed at yesterday's rally by those in the diverse opposition that accuse the Reagan administration of supporting Marcos.

A large banner depicting a crowd storming up a hill toward the president and his wife, Imelda, carried the slogan, "Oust the U.S.-backed Marcos regime." Other signs read "Down with the U.S." and called for an end to the "U.S.-Marcos dictatorship." Others said, "Reagan stay home--go to hell," a reference to President Reagan's scheduled visit here in November.

Leftist student demonstrations here frequently have an anti-American flavor and usually demand cancellation of agreements that permit the operation of large U.S. naval and air bases. But until today, the anti-American theme had not been prominent in the protests arising out of Aquino's murder.

The protest was organized by a spectrum of opposition groups led by such figures as former senator Salvador Laurel, former Philippines president Diosdado Macapagal, and Jose B. Laurel, president of the Nationalist Party.

Their joint manifesto demanded an end to, among other things, "the arrogant presence of alien military bases" and pledged to resist "all forms of alien control or domination."

Yesterday was picked for the climax of several demonstrations because it was one month after Aquino was shot to death and because it was also the 11th anniversary of Marcos' proclamation of martial law in 1972.

The government once called Sept. 21 "national thanksgiving day," in honor of the martial-law proclamation, but the sponsors of yesterday's protest called it "a day of national sorrow."

The crowd consisted of many students and workers but it also reflected the recent presence in the anti-Marcos movement of middle-class businessmen and professionals. There were young toughs in red headbands who climbed trees to hear the speeches, but there were also nuns clinging to the tops of cars to see the scene.

Susan Flores, an employe of a garment exporting firm in Makati, said she had joined recent protests because she and her friends hold the government responsible for Aquino's death. "It's been an awakening," she added. "Before, we worried only about getting three meals a day. Now we're worried about our children and what will happen to them in this kind of a society."

Dr. Alicio Tosi, a dental surgeon, raised his hand to join in a pledge of unity along with the many thousands clustered in the plaza. It was only his second demonstration and he was rather timid in describing why he had come. "I think we have got to manifest what we believe in," Tosi said. "If we are silent, it is construed as being approval of the palace."