It’s a changing of the guard — new tech leap-frogging old tech.

Amazon stock surged 2.6 percent on Wednesday, allowing the company for the first time to close trading with a market cap more than that of Microsoft.

Amazon’s market cap, after a torrid year when it soared 75 percent, stood at of $702.5 billion — making it the No. 3 most valuable company in the world.

Microsoft, whose value has gained 42 percent in the last 12 months, has a market cap of $699.2 billion.

Apple, worth $849.2 billion, and Google parent Alphabet, worth $745.1 billion, are the only companies worth more than Jeff Bezos’ Amazon. Facebook stand at No. 5 with a market cap of $521.5 billion.

The value ranking of the tech titans was stable throughout 2017, although Amazon has been on the upswing since cracking the Top 10 in the fourth quarter of 2015.

Its market cap has since more than doubled — an increase that turned its founder and chief executive, Jeff Bezos, into the world’s richest person.

Bezos took the wealth crown earlier this year from his Seattle neighbor and Microsoft co-founder Bill Gates.

The Bloomberg Billionaires Index put Bezos’ net worth at $118 billion on Wednesday, having benefitted from a $2.2 billion gain during the day and a $19.3 billion increase year to date.

Gates’ wealth was $90.3 billion, up $92 million for the day, but down $1.6 billion year to date.

Amazon briefly overtook Microsoft in intraday trading on Feb. 7, but then its stock pulled back 3 percent before closing to keep the online retailer in fourth place for another