Mazda Motor Co. has decided to stop building the midsize Mazda6 sedan in the U.S., raising questions about the future of a U.S. factory that it runs jointly with Ford Motor Co.

The Japanese automaker said Monday that it will continue building the 6 at the factory in Flat Rock, Mich., near Detroit, until the end of the current model's life cycle. But the next version of the 6 will be built at Mazda's Hofu plant in Japan, the company said.

A company spokesman wouldn't say when U.S. production would stop, nor would he say whether Mazda would pull out of the joint venture, called Auto Alliance International.

The company says that it made the decision mainly because of changing demand in North America. In Mazda's case, people are buying more crossovers and small cars rather than midsize sedans, company spokesman Jeremy Barnes said. Crossovers are SUV-like vehicles that are built on car underpinnings.

Sales of the Mazda6 have been slow of late, down 9 percent through May to 13,604.

The Flat Rock factory, which employs about 1,700 people, also makes the sluggish-selling Ford Mustang, which has seen a 3 percent sales decline through May.

Mazda is studying future uses for the factory with Ford, and both companies are committed to continuing the partnership, Mazda said.

Barnes could not say whether Mazda will build another model at the factory in the future.

"Everything is open to discussion at this point in time," he said.

The current version of the Mazda6 made its debut in 2007. The company normally updates its models every four or five years, meaning that the production of the new version could cease as early as the end of this year.

Ford said in a statement that the plant is critical to its U.S. factory system, and that it's working with Mazda and the United Auto Workers union to study options after the Mazda6 production ends.

The plant started as a Mazda factory in 1987 and became a joint venture with Ford in 1992. It has built 1.7 million Mazdas in its lifetime.

Mazda and Ford have been partners since 1979, when Ford bought 25 percent of the struggling Japanese carmaker. Ford raised its stake to 33.4 percent in 1996. But Ford began cutting ties in 2008, when it was trying to cut brands and costs. Last year, Ford lowered its ownership to 3.5 percent.

Fox Car Report is on Twitter. Follow us @foxcarreport