General Motors Corp. and Toyota Motor Co., in the first venture of its kind in the United States, yesterday announced a $300 million agreement to produce small, front-wheel-drive cars at GM's idle assembly plant in Fremont, Calif.

The agreement would produce an estimated 200,000 small cars annually, which GM would sell through its Chevrolet Division. The new subcompact car will replace GM's aging, rear-wheel-drive Chevette.

The joint production agreement must be approved by both the Federal Trade Commission and the Justice Department to determine if it meets U.S. antitrust guidelines. The two companies said the agreement also depends on whether they can reach a suitable contract with the United Auto Workers union.

The agreement announced yesterday will be in effect for at least 10 years and possibly 12 years, company officials said. Formal signing of the joint venture pact will take place Thursday in Fremont.

GM Chairman Roger B. Smith, citing "competitive reasons," refused to give details on the new car, other than to say that "it will be a specific design for Chevrolet. We need a new entry into the subcompact end of the business that attracts first-time buyers." The new car is scheduled for production in the fall of 1984.

"Our experience shows that nearly three-fourths of these buyers will stay with GM through their car-owning lives. So, we must have a car to offer them," Smith said yesterday in Detroit.

The Chevette, GM's current entry-level car, is a four-cylinder model often criticized for sacrificing passenger room because of a front-to-rear drive shaft that consumes interior floor space. GM wants a front-wheel-drive replacement that allows more interior space and has a better exterior appearance than the boxy Chevette.

Some industry observers have speculated that the GM-Toyota car would resemble Toyota's Corolla. But Smith attempted to downplay that speculation yesterday by saying the new car "is not a copy of any car being offered in this country."

GM believes the joint venture will help it reduce development and production costs of a new small car. Smith and other GM officials have argued that they needed a coproduction agreement because the Japanese can produce small cars for $1,500 to $1,700 less per vehicle than U.S. automakers.

Toyota officials hope the agreement will undercut rising protectionist sentiment in the United States because it will create jobs here. The agreement calls for 50 percent U.S. content in the jointly produced cars, meaning that at least half of the parts going into the cars would come from this country.

Japanese automakers have operated under voluntary restraints on their exports to this country for the last two years. They soon are expected to agree to a third year of voluntary restraints, which now limit their sales of passenger cars in the United States to about 1.8 million annually --22.6 percent of the current U.S. auto market.

The growing Japanese market share has led to calls for mandatory trade restrictions and laws requiring foreign car manufacturers to use a certain amount of U.S.-built content in cars sold in the United States.

GM estimates 3,000 workers will be involved in the coproduction effort at Fremont. In addition, another 9,000 U.S. jobs could come from supplying the GM-Toyota operation, Smith said.

Officials of United Auto Workers Local 1364 said yesterday that the Fremont plant employed about 6,800 people when GM closed it last spring.

It was not clear yesterday how many, if any, of the GM-Toyota jobs would be filled by laid-off Local 1364 workers.

Under the agreement, GM and Toyota will have equal representation on the board of directors of the joint venture. But Toyota will have the right to select the new operation's president and chief executive officer.

GM officials insisted yesterday, as they have all along, that the Toyota pact is temporary--to last only until GM develops a competitive small-car product of its own.

"We imported the Opel Kadett from Germany for a number of years until economic conditions made it more competitive to produce the Chevrolet Chevette in the United States," Smith said. "Even more recently, we imported small trucks from our long-time Japanese affiliate, Isuzu. We did that until we could design and tool up our own new S10 and S15 trucks, which are now the most popular small trucks sold in the United States."

Smith added: "Now, it makes sense to do the same kind of thing with Toyota for a few years so we can continue to participate in the small-car business, attract first-time buyers and preserve American jobs."