It said the compression ignition engine was up to 30% more fuel-efficient than its current engines.
It plans to sell cars with the new engine from 2019.
Last week, Mazda said it would work with Toyota to develop electric vehicle technology and build a $1.6bn plant in the US.
Mazda research and development head Kiyoshi Fujiwara said it was imperative for the company to pursue the "ideal internal combustion engine".
"Electrification is necessary but... the internal combustion engine should come first," he said.
Mazda said the Skyactiv-X, as it is known, would be the world's first commercial petrol engine to use compression ignition.
The technology breakthrough puts the firm ahead of rivals including Daimler and General Motors that have worked on compression ignition for decades.
According to Mazda, the fuel-air mixture ignites spontaneously when compressed by the piston in the new engine.
The carmaker said the Skyactiv-X combined the advantages of petrol and diesel engines to improve efficiency.
It has no plans to supply the engine to other carmakers.
The move comes as the car industry pours massive investment into electric technology in response to stricter emissions standards around the world.
The UK will ban the sale of new petrol and diesel cars by 2040 in a bid to reduce air pollution.
In July, Volvo said all new models will have an electric motor from 2019. The Chinese-owned firm aims to sell one million electric cars by 2025.
Mazda also plans to introduce electric technology in its cars from 2019.
In theory, a compression-ignition petrol engine should have big advantages.  But it isn't easy to make technology work - and some of the biggest companies, including General Motors, have already tried.
So why should a relatively small Japanese manufacturer like Mazda succeed? Well, partly because - unlike the really big players - it isn't afraid to take risks. It has done in the past.
It's the only mainstream manufacturer, for example, which has persisted with rotary engines in its cars. Like compression ignition motors, they have theoretical benefits, but create complex engineering challenges.
Mazda's rotary has had some success. The company won the Le Mans 24 Hours race with it in 1991, and the latest version was fitted in its RX-8 sportscar. Popular with drivers, it was sadly unreliable.
If the new motor is to be a success, it needs to be reliable as well as efficient. And Mazda needs to be able to persuade regulators that petrol engines still have a strong future.
It may prove to be the perfect stop-gap, as electric cars are developed and charging infrastructure is created.
Or it may turn out to be a brilliant idea, which has come to fruition just a few years too late.

The building is to be developed on a site between Longman Road and Burnett Road to the north of Burnett Road Police Station.
The new centre would allow the courts service to move out of historic Inverness Castle.
The Scottish government is to fund the construction of the new two-storey Inverness Justice Centre.
The Scottish Courts and Tribunals Service has proposed that the centre has six courtrooms.
It would also have facilities available for supporting and advising victims and witnesses of domestic abuse, sexual violence and provide "an environment for problem solving approaches" to help reduce re-offending and child abuse.
Justice Secretary Michael Matheson has said the centre would be an important development for the city and the wider Highlands area.

According to reports, South Korea sports minister Do Jong-hwan said North Korea could host some skiing events.
He also said the countries may enter a combined ice hockey team.
"We are happy to discuss his ideas. The Olympic movement is always about building bridges, never about erecting walls," said an IOC spokesperson.
"We are looking at the comments of the new minister of sport, culture and tourism with great interest."
The Games in Pyeongchang, South Korea, will take place from 9-25 February.
In comments reported by the Korea Herald, Do suggested the North and South could enter one women's ice hockey team, helping to make Pyeongchang a "peace Olympics".
He said he would discuss co-hosting at the Masikryong ski resort with Jang Woong, North Korea's delegate to the IOC.
Earlier this month, South Korea's new president Moon Jae-in said North Korea could be part of a bid to co-host the 2030 football World Cup across north-east Asia.
Moon, the son of refugees from North Korea, advocates greater dialogue with their neighbours.
Japanese carmaker Mazda has developed a more efficient petrol engine at a time when the industry steers toward electric vehicles.
[NEXT_CONCEPT]
Plans have been submitted to Highland Council for the new Inverness Justice Centre.
[NEXT_CONCEPT]
Proposed collaboration between North and South Korea at the 2018 Winter Olympics has been welcomed by the International Olympic Committee.