American Motors Corp. and China's Beijing Automotive Works have agreed to produce a four-wheel-drive civilian Jeep for sale in China and elsewhere in the Far East, sources familiar with the agreement confirmed yesterday.

The 20-year, $51 million pact--the first joint-production arrangement involving U.S. and Chinese automotive companies--will be signed Thursday in Peking, the sources said.

Production will be based in China and will start at the end of 1983, the sources said.

"This is a major breakthrough for American Motors. This gets the company onto the ground floor of a developing market," said a ranking American automotive official who is knowledgeable about the "agreement in principle" between AMC and Beijing.

The agreement, reached last month, is expected to help AMC compete against Japanese automakers who have been aggressively introducing four-wheel-drive vehicles in the Far East.

"The major growth markets of the future will be beyond our borders," AMC Chairman W. Paul Tippett said last January, hinting at his company's overseas strategy. The key growth market will be China--"a nation with a billion people, a billion bicycles, but no cars," Tippett said then.

Japanese automakers "fought AMC at at every turn" in AMC's bid to win the China pact, one American source said. "They didn't want any competitors in that market. But they're going to get competition if this deal works out okay," the source said.

The source added: "There was no other way for AMC to compete with the Japanese in the Far East without an agreement like this. AMC is going to get a good-quality, low-cost product out of this venture. And that's what AMC needs to compete in that market."

Beijing, in turn, is expected to benefit from the technological expertise AMC brings to the partnership. And although the joint-venture product will be sold exclusively in the Far East, it could open the door a little wider for products Beijing wants to export to the United States.

Those exports include about 5,000 Beijing Tigers--four-wheel-drive utility vehicles--the first of which is scheduled to arrive in this country later this year. The Tiger, which is similar to the standard AMC Jeep, will retail for about $6,000.

Under the terms of the joint-venture agreement:

* AMC will invest $16 million--about $8 million in cash and $8 million in equipment and related technology. AMC initially will own about 31 percent of the joint venture, but will take profits from the operation and buy stock, increasing AMC's ownership to a maximum 49 percent.

* Beijing will invest $35 million.

* The president and chief executive officer of the joint venture will come from AMC.

* AMC also will "contribute" 10 technicians to the joint venture.

* The joint-venture partners initially will produce "an improved version" of Beijings's current four-wheel-drive, overland vehicle, the B-J 212. The improved version will be a four-cylinder, four-wheel-drive model designed by AMC.

* The B-J 212 eventually will be replaced by a version of AMC's Jeep C-J.

AMC and Beijing negotiated four years before reaching agreement on the joint-venture plan, which is expected to create 4,000 jobs in China.

"We had four different Chinese delegations to come to our country, talk to us and walk around our plants. They were very cautious," an AMC official said. AMC's French partner, Renault, "had nothing to do" with the joint-venture plan, the official said.

AMC officials conceded that they were taking a chance in the overseas partnership. "But, all things considered, it's not a big chance. Sixteen million is not that much money in the car business. And besides, Beijing is making money right now. We're buying a percentage of a profitable corporation," the AMC official said.

Asked why the jointly produced vehicle initially will be limited to Far East distribution, the AMC official said: "The vehicles we are going to build over there aren't as sophisticated as those we sell here."

Reliable sources said recently that the Department of Commerce supports the agreement and sees it as a way of strengthening U.S.-China relations, which have soured in recent months. Tippett met last month with Commerce Secretary Malcolm Baldrige to discuss the plan.

General Motors Corp. earlier this year signed a similar agreement with Toyota Motor Corp. Ltd. to produce front-wheel-drive cars in Fremont, Calif.