Television footage showed flames leaping high into the night sky above the Ujina plant in Hiroshima, where the automaker is headquartered. The fire department dispatched 21 trucks and two ambulances to the scene.
Authorities received a call at 11:00 p.m. (1400 GMT) reporting flames in a part of the facility where vehicles are painted and finished, a Hiroshima fire department official said on condition of anonymity.
Firefighters still hadn't extinguished the blaze more than an hour later because of gas wafting out of the factory, the official said.
The cause and extent of the fire were not immediately clear.
Mazda is 33.4 percent owned by Ford Motor Co.
Last month Mazda reported a 68 percent jump in profit for the six months through Sept. 30 and raised its outlook for the full year, citing strong sales in Europe.