Hundreds of thousands of Pakistanis roared their condemnation of President Mohammed Zia ul-Haq and their support for Benazir Bhutto today as the opposition leader returned from political exile.

The return of the daughter and political heir of former prime minister Zulfiqar Ali Bhutto appeared to mark Zia's most serious domestic political challenge. She has vowed to campaign for Zia's resignation and for immediate national elections to replace the man who overthrew her father in 1977 and then saw him executed.

Before her return, Bhutto, 32, had told interviewers in London that she would not launch a "frontal attack" on Zia's government. But, speaking at a massive rally in Lahore's old city tonight, Bhutto said that if Zia refused to step down and schedule new elections, "the people will pursue their own line of action."

The massive welcome -- which many local residents judged the largest gathering in Lahore since Pakistan's formation -- confirmed that Bhutto retains a powerful hold over a substantial segment of the population for which her father remains a political hero.

Inching through the often frantic crowds, her motorcade needed 10 hours to travel the eight miles from the airport to the rally. Bhutto supporters stripped the flowers from public gardens along the route to toss them at Bhutto's truck, at foreign correspondents and each other.

The crowd was sometimes euphoric but more often angry, chanting slogans against Zia and U.S. support for him. "America is the murderer of Ali Bhutto and Pakistan," they chanted.

At one point -- amid a forest of red, green and black flags of Bhutto's Pakistan People's Party -- a half dozen U.S. flags waved above the demonstrators before bursting into flame, one by one.

"We knew she would get the largest crowd," said Mohabbat Ali Dogar, a Lahore lawyer and a senior official of Prime Minister Mohammed Khan Junejo's Moslem League party. "She is very popular here in Punjab, and the government is keeping its hands off" the demonstration.

In 1977, Zia overthrew Ali Bhutto in a military coup and immediately declared martial law. Zia lifted the martial law last December as part of a controlled return to civilian rule.

With the encouragement of the Reagan administration, Zia last year held nonpartisan elections to a National Assembly -- elections that Bhutto's party and other opposition groups boycotted as unfair. The elections gathered a respectable turnout, however, and produced a conservative assembly from which Zia appointed Prime Minister Junejo and a civilian Cabinet.

Bhutto's party and the 11 smaller members of the opposition Movement for the Restoration of Democracy have been permitted to resume political activities under civilian rule, but have insisted on new elections, which they say cannot be fair under Zia's authority.

Bhutto landed shortly after dawn at Lahore International Airport, where other flights were canceled, as riot police were deployed and barbed-wire barricades were set up to hold back thousands who had gathered overnight to greet her. Although the authorities had called in thousands of police from surrounding areas, they were kept out of view during the day in an attempt to avoid provoking the often hostile crowds.

During today's motorcade, the crowd's most consistent chant proclaimed, "Zia is a dog," and demonstrators laughed at a man who portrayed the Pakistani ruler by crawling along the street with a leash around his neck. Demonstrators shouted over the constant beat of drums and the chanting crowd to explain their anger.

"The reason we support Benazir is because Zia has brought us years of martial law and repression," shouted Parvaiz Gill, a Lahore veterinarian. Referring to the name Pakistan, which translates as "land of the pure," Gill said, "Zia has given us not a democratic Pakistan but his own Pseudostan."

"There have been no human rights under Zia's martial law," said Tariq Rahim, a university engineering student. "Zia claims to rule in the name of Islam, but his martial law is anti-Islamic."

During the motorcade, Bhutto showed neither the anger nor the euphoria of her supporters. Appearing self-conscious, she waved and saluted to the crowd with the same gestures her father once used, and periodically readjusted a scarf over her head when it slipped to her shoulders.

Arriving this evening at Lahore's independence monument to address the rally, Bhutto was nearly crushed among her supporters packed tightly around the podium. Angered at being pushed, she suddenly lashed out at a young man, shouting at him as she grabbed him by the hair and slapped him.

Her voice often shrill, Bhutto repeated a comparison she has made in recent weeks between Pakistan and the Philippines, whose people recently deposed an authoritarian president, Ferdinand Marcos. "Marcos had to run from the Philippines," she said, "and after this evening another dictator will have to run."

Bhutto declared that her massive welcome represented a popular referendum in Lahore against Zia.

Bhutto tried to reinforce her traditional appeal to many Pakistanis as the political successor to her father -- and as a woman who, with her family, has suffered under Zia. She told of promising her father, in their last conversation before his execution, to pursue the populist political themes that made him almost a cult figure for many in this country.

The longstanding anti-American stance of the Bhutto party -- beginning with Ali Bhutto, who accused the United States of engineering his downfall -- was symbolized by a massive portrait, hung near the podium, that showed Bhutto clasping hands triumphantly with Libya's Col. Muammar Qaddafi. But in her speech, Benazir Bhutto left out the anti-American rhetoric of many of her supporters, and noted that she had visited both Washington and Moscow in the weeks before her return.

Responding largely to criticism from leftists in the opposition who suggested she might be coopted by the United States, Bhutto insisted that she held a balanced position between the two superpowers and had acted only "as the agent of the Pakistani people."