President Reagan told Congress yesterday that he has ordered production to begin in October on a new generation of chemical artillery shells, apparently ending a four-year battle on Capitol Hill and a 17-year moratorium on U.S. production of nerve gas weapons.

The president certified to Congress that the administration has met conditions for production attached to this year's defense spending bill. Congress was to release $21.7 million in production funds for the controversial weapons after the president gave notification that Western European allies had approved the program.

House and Senate opponents of the new weapons, however, vowed that the battle was not over. Rep. Dante B. Fascell (D-Fla.), chairman of the House Foreign Affairs Committee, and Sen. David H. Pryor (D-Ark.), a leader of the antichemical-weapons group in the Senate, argued yesterday that Reagan had not met the congressional conditions and said they would make a new effort to halt production by amending the fiscal 1987 defense authorization bill now before Congress.

The so-called binary shells, made up of two nontoxic chemicals that only become deadly when mixed after the shell is fired, would not begin to come off the assembly line until 1988, according to Pentagon sources.

Under agreement with NATO allies, the United States would store the binary shells in this country and would send them to Western Europe "under appropriate contingencies," according White House spokesman Larry Speakes.

In another administration move on chemical weapons, Secretary of Defense Caspar W. Weinberger in the next few days is expected to certify that a second binary weapon, the Bigeye bomb, has passed operational tests, according to congressional sources.

A General Accounting Office report on the Bigeye, made public by Fascell last month, said recent Bigeye tests left "unresolved" operational problems with the bomb. GAO concluded that "the bomb should either move back to developmental and chemical testing . . . or should be abandoned in favor of newer concepts."

In a statement, Fascell said, "The binary program is based on a flawed strategy using flawed weapons."

In announcing Reagan's approval of artillery-shell production, Speakes said, "The small, readily deployable stockpile of binary weapons which we seek will provide the flexibility to meet and deter" a worldwide chemical weapons threat.

He also declared that the United States "renounces the first use of lethal and incapacitating chemical weapons" and seeks a verifiable, comprehensive ban on all chemical weapons as "our foremost priority."

However, during a White House briefing yesterday, Don Mahley, a member of the National Security Council staff, said negotiatons in Geneva on the U.S. proposal for a chemical arms ban had not progressed because of a requirement for on-site inspections of potential production facilities.

In last year's legislation, Congress said U.S production of binary weapons had to have NATO approval. In addition, Congress required formal adoption of the program by the North Atlantic Council (NAC), a group made up of foreign ministers of the alliance.

In the certification, Reagan said a subgroup of NAC, made up of defense representatives, had approved, under normal procedures.

Fascell and Pryor, however, argued that did not satisfy the provision of the law and produced a legal brief to support their positon. It was unclear what they planned to do.