PALM SPRINGS, CALIF., JAN. 2 -- President Reagan and Canadian Prime Minister Brian Mulroney today signed the most far-reaching trade agreement ever negotiated between two nations, an accord that the president said "will encourage supporters of free trade throughout the world."

Reagan put his signature on English and French-language versions of the historic pact during a break in his holiday at the estate of publishing magnate Walter Annenberg. Before signing the documents, he exchanged congratulations in a four-minute telephone call to Mulroney, who signed the agreement in a ceremony at his Parliament Hill office in Ottawa more than 1,700 miles away.

"The agreement would not have been possible without your leadership, vision and political courage," Reagan was quoted in a White House statement as saying to Mulroney. "You took office with a belief in free trade and free markets, and the Canadian citizens are better off."

"We had an excellent conversation," Mulroney told reporters. "He {Reagan} expressed great satisfaction in the accomplishment of this treaty, which sends a very strong signal internationally at a time when the lure of protectionism is there for all to see.

"I have urged the president to ensure that the drafting of U.S. legislation takes place as expeditiously as possible to permit its early introduction into the U.S. Congress," Mulroney added.

The trade agreement, which eliminates most tariffs between the two nations over a 10-year period, is scheduled to take effect on Jan. 1, 1989, if ratified by Congress and Canada's Parliament.

While White House officials have predicted that the accord will be ratified, it faces protectionist opposition on both sides of the border. Its stiffest test is likely to come in Canada, where some have complained that the agreement would lead to economic and cultural domination by the United States.

A public opinion poll released this week found 40 percent of Canadians favor the agreement, while 39 percent opposed it and 21 percent were undecided. The poll, conducted by Toronto-based Environics Research Group Ltd., also indicated 57 percent of those polled like the concept of free trade with the United States, while 32 percent were opposed and the rest were undecided.

Both opposition parties have threatened to scrap the accord if they oust Mulroney's Progressive Conservative Party in the next parliamentary election, which could come as early as September.

Main opposition Liberal Party leader John Turner, speaking to reporters in Toronto, pledged to "fight it every inch of the way."

In London, Ontario, about 250 people gathered today in 7-degree weather to fill a black coffin with Canadian products they said would be endangered if the agreement becomes law. Canadian trade unions organized demonstrations at bridges across the border to Buffalo and Detroit.

In the United States, the measure could be nullified by a pending omnibus trade bill that Reagan has threatened to veto if it passes Congress. White House officials say they believe Reagan could sustain a veto, but they are worried that continuing large trade deficits will give opponents of the free trade pact a potent argument against ratification.

In a statement and in his regular radio speech today, the president pledged to do his best to win ratification of the accord. A demonstration in support of the pact was held by the mayors of Prescott, Ontario, and Ogdensberg, N.Y., at the foot of an international bridge, and other pro-treaty rallies were held in some western U.S. and Canadian border communities.

"The creation of the world's largest free trade area will be a mark of leadership and presents an historic opportunity to the United States and Canada," Reagan said in the statement. "We must not let this opportunity slip from our grasp."

Key provisions of the agreement would:

Eliminate nearly all cross-border tariffs and nontariff trade barriers over a decade, slightly reducing the prices that Americans and Canadians now pay for goods exchanged between their countries. The most politically sensitive tariffs, such as those on steel and textiles, would be lifted late in the process. Ban imposition of import and export quotas on most products. The two nations agreed to keep the existing pact which allows U.S. automakers to manufacture cars and parts in Canada for duty-free sale in the United States, but denied any similar future benefits to the Japanese or Koreans. Assure "fullest possible" energy trade between the two nations, including Canadian access to oil from Alaska's North Slope. Ease numerous restrictions on cross-border investment. Basically, investors of each country would be allowed free access to each other's market. Provide a five-person tribunal to settle disputes that cannot be resolved by arbitration.

U.S.-Canadian trade amounts to more than $150 billion. According to the U.S. government, the United States had a trade deficit with Canada of $13 billion to $20 billion in 1987.

Reagan, clad in sports clothes, paused for only a few minutes in his vacation today to sign the agreement in a ceremony witnessed by White House chief of staff Howard H. Baker Jr., national security adviser Colin L. Powell, CIA Director William H. Webster, and Nancy Reagan.

Tonight, the president and former president Gerald R. Ford participated in the dedication of a new Bob Hope cultural center here. Reagan is scheduled to return to Washington on Sunday.