Toyota will invest $150 million at its Tijuana, Mexico, assembly plant to increase output of the popular Tacoma pickup amid tight inventory that the company says has held back sales.

The expansion will bump capacity to about 160,000 units annually in late 2017 or early 2018, from just over 100,000 currently, the company said in a statement Wednesday.

The move comes at a time when the Tacoma’s dominance of the U.S. midsize pickup market — which has grown 21 percent this year — is being challenged by General Motors, which returned to the segment for the 2016 model year with its well-received Chevrolet Colorado and GMC Canyon. Honda’s Ridgeline, too, is back in the market and selling briskly, and Nissan’s Frontier pickup is up nearly 45 percent this year. Ford plans a return with the Ranger as well.

Tacoma sales are up 4 percent this year through August, but its share of the midsize market has shrunk to 43 percent, from 51 percent a year earlier, amid the new competition. Toyota’s investment in capacity represents a bet that it can reclaim some of that share, and capture more of the segment’s growth, by increasing supply, even as the overall light-vehicle market begins to soften.

“Demand for trucks has grown exponentially,” Toyota Motor North America CEO Jim Lentz said in the statement. “By leveraging our manufacturing facilities’ availability and expertise, we can be nimbler and better adjust to market needs in a just-in-time manner.”

The Baja plant is currently stretched to its limit, having added a third shift in April 2015, executives at the plant said during a recent tour. The plant runs 24 hours a day Monday through Friday, plus two shifts on Saturday, then closes for maintenance.

Last year, Baja’s production was just over 82,000 trucks as the plant adjusted to the third shift and gradually increased output. Through August of this year, it has pumped out just over 63,000 units, according to Automotive News data.

Toyota is adding about 400 jobs in Baja, Mexico, to handle increased output of the Tacoma pickup.

The Tacoma is also produced at Toyota’s much bigger pickup plant in San Antonio, where it shares the assembly line with the full-size Tundra. San Antonio produced about 111,000 Tacomas in 2015 and 122,000 Tundras.

The Texas plant added a Saturday shift earlier this year to increase capacity to around 250,000 per year, according to David Crouch, vice president of administration and production control at the factory.

U.S. sales of the Tundra are off 7.7 percent this year through August, compared with a 2.8 percent rise for the full-size pickup segment overall. Crouch said supply is a big reason: Toyota dealers don’t have enough pickup inventory on the lot to tempt shoppers to buy.

“Obviously, one of the biggest challenges that we have for Tundra and Tacoma is we’re capacity-limited,” he told Automotive News in July. “We could sell a lot more trucks right now.”

The Baja plant is unique for Toyota in North America, since it operates around-the-clock, uses limited automation and began life in 2004 mostly to supply Tacoma truck beds to a now-closed assembly plant in California.

Toyota will add about 400 jobs in Baja to handle the new production, the company said.