BMW gained ground last month in the U.S. luxury sales race.

BMW has pulled to the back bumper of Mercedes-Benz in the annual United States sales race thanks to a record-setting June.

Fuel by strong demand for its 3-Series line of vehicles, BMW's June sales jumped 25 percent to a company record 27,074 vehicles. Mercedes-Benz tallied 24,415 sales in June, an improvement of 9.8 percent.

That strong month helped BMW to close the gap with Mercedes to just 1,519 units. Moreover, that lead is shrinking fast as Mercedes held a 4,178 vehicle advantage at the end of May.

"It's part of a prevailing trend of near-luxury sales overall," Alec Gutierrez, a Kelley Blue Book analyst, told The Detroit News. "The available lease offers on 3 Series has been a pretty significant driver, too. We've seen promotions from the low- to mid-$300s a month. Even the 335 can be had for $400 a month. That's a lot of car for $400 a month."

For the year, BMW's sales have improved by 11 percent to 140,431 units. During the same period Mercedes' sales have increased 10 percent to 141,950 deliveries.

BMW has beaten out Mercedes-Benz for the U.S. luxury sales crown each of the last two years.