Police arrested at least 40 of Prime Minister Zulfiqar Ali Bhutto's opponents today as Pakistan's largest labor organization urged the armed forces to end their support of the prime minister in the continuing campaign to force him from office.

Officials of the opposition political front, the Pakistan National Alliance, were arrested here and in the Punjab provincial capital, Lahore. Nearly all of the top leaders of groups calling for Bhutto's resignation are now in jail.

The National Alliance and the 20 unions in the Pakistan Labor Alliance are attempting to a two-pronged tactic: appealing to the military to turn against Bhutto, and demanding an end to the martial law that he imposed on Karachi, Lahore and Hyderabad on Thursday.

Maulana Maudoodi, the founder of the Moslem fundamentalist Jamaat-i-Islamic Party, which is a member of the nine-party National Alliance, told a news conference in Lahore that martial law must be withdrawn because it is "illegal and unconstitutional." It is unlikely that Moudoodi's remarks will be reported in Pakistan because censorship was imposed last night on any information about the nationwide anti-Bhutto agitation.

Some observers here believed that Bhutto will try to have the constitution amended during a session of the National Assembly in the capital. Islamabad, on Tuesday. They predict that once the amended constitution legalizes martial law, Bhutto will have himself named chief martial law administrator.

Such a move could further antagonize millions of Pakistani in Karachi and other cities. A number of people here have said in the last few days that they would be willing to accept martial law for a short period, provided the armed forces then supervised new national elections.

The National Alliance and its followers in the labor movement claim that the March 7 elections were regaged, enabling Bhutto to win 155 of the 200 National Assembly seats. The opposition members have refused to sit in the new Assembly.

If it succeeds, the Labor Alliance's effort ot alienate the armed forces from Bhutto could break his tenacious grip on power. Right now, only the support of the armed forces enables the besieged prime minister to stay in office.

In a telegram to the chairman of the joint chiefs of staff and the chiefs of the three armed services in Rawalpindi, Labor Alliance President Mohammed Sharif said, "An immediate political solution is hightly essential to save the nation. The armed forces have always saved the nation and they should do so now, not by coercing the workers and people, but by removing Mr. Bhutto."

Sharif's message was prompted by an incident here Friday, when armed troops killed 11 persons demonstrating against Bhutto during a break in the curfew. It was one of the rare times in Pakistan's turbulent 30-year history when soldiers, rather than police, have fired on West Pakistani civillians.

In most cases of organized violence, police have done the shooting. A major exception was the nine-month civil war in 1971 in what was then East Pakistan. The army was accused of killing between 250,000 and a million East Pakistanis during the uprising that led to an Indian invasion and the creation of the state of Bangladesh.

"During the s last few days," Sharif said in his message to the armed forces chiefs, "many people have been killed, bringing mass resentment against the armed forces because they feel all this is done to support the totally rejected Mr. Bhutto, who clings to the partnership."

In another attempt to break the link between Bhutto and the military, three leaders of the National Alliance, including acting president Nawab Zada Nasrullah Khan, asked for a meeting in Rawalpindi with the army chief of staff, Gen. Ziaul Haq. THe three were arrested, as all the top opposition leaders already had been.

The Pir of Pigaro, a leader of the Moslem League faction of the National Alliance, was elected to replace Nasrullah. Alliance sources said a new three-man delegation will attempt to meet Haq later this week. One source said, "They will be courting arrest, because we do not believe Mr. Bhutto will allow General Haq to receive them."

The National Allaince also announced that it is organizing a mass protest March on Bhutto's residence in Rawalpindi next Saturday. "We intend to surround Mr. Bhutto's house and keep him confined until he comes to his senses and resigns," an Alliance source said here.

Pakistan's economic life remains at a standstill. Industry in Karachi, the largest city and the center of more than half of the country's factories, has not operated since the Labour Alliance called a general strike last Wednesday. The strike has spread to other cities and was a major factor in Bhutto's decision to impose martial law and curfews.

A labor union source said that for the first time since the strike was called, some workers reported to Karachi's docks today. He added that he expected more would work Monday, "as they are under threat by the army." Sources of ships are backed up in the port, under military guard.

Seeking the intervention of U.S. and international labor organizations, Labor Alliance president Sharif issued what he called an "SOS" in which he said that trade union activity has been banned and fundamental rights suspended. "We urgently appeal that you intervene in our situation and address strong protest and condemndation telegrams to the president of Pakistan," Shariff's message said.