McGregor (18-2), the brash 26-year-old Irish featherweight who has taken mixed martial arts by storm, knocked out Mendes at 4:57 of the second round to claim the interim championship Saturday night.
The fight headlined UFC 189 before a sold-out crowd of 16,019 inside the MGM Grand Garden Arena.
The pay-per-view card, which at $7.2 million set a new UFC record for live gate revenue in the United States, was supposed to feature McGregor (18-2) challenging seven-time defending champion Jose Aldo for the undisputed crown, but Aldo withdrew June 30 after suffering a rib injury in Rio de Janeiro.
Aldo (25-1) has stated the injury is a broken rib, but he is expected to be healthy enough to possibly return this year.
"In my opinion, Jose went running," McGregor said after his win. "I had bigger injuries leading up to this fight than a bruised rib, and I still showed up and performed. In my eyes, Jose went running. If he wants to come back, he can come back -- but I swear to God, his day will come."
The fight was easily the most difficult of McGregor's UFC career. A former two-time title challenger, Mendes (17-3) took McGregor down in each round and opened a cut over his right eye in the first.
He caught McGregor flush on the chin with several counter left hooks and right hands, but McGregor's primary response to the shots was to nod and continue moving forward.
Late in the second round, after spending most of it on his back, McGregor caught Mendes with several straight left hands and a kick to the body. Mendes toppled over near the fence, where McGregor stood over him and threw left hands until referee Herb Dean stepped in.
"I have been hearing all the time that I've been protected to this point and gifted a title shot," McGregor said. "So, when my title shot went running and I was given a shot at what I was supposedly being protected from, I was going to prove that I'm a true fighter."
Mendes did not protest the finish, despite the fact that it came with a mere three seconds remaining in the round.
"I'll have to see it, I have no idea," Mendes said. "I remember getting back to my feet and my feet were planted. That was the mistake I made and Conor was able to stand in front of me and tee off. I don't know how fast the stoppage was. If Herb thought it was done, then it was done. He's the one that makes the decision, not me."
Some wondered whether McGregor's confidence would slightly diminish, having to switch from a lanky standup fighter in Aldo to a compact wrestler in Mendes. If anything, McGregor appeared overconfident in the fight.
At the start, McGregor threw a spinning back kick in the amount of time it took for him to sprint across the cage. He followed that with a leaping knee, which Mendes sidestepped and turned into a takedown. McGregor managed to work back to his feet quickly and went on taunting Mendes.
After jumping to an early 10-9 lead on the scorecards in the opening round, Mendes capitalized on another takedown in the opening moments of the second round. McGregor struggled to get back to his feet and, at times, didn't even appear interested in doing so. He batted Mendes' ears with palm strikes and threw elbows to the top of his head. At one point, he looked up at the referee to argue for a standup.
With one minute left in a round he was clearly winning, Mendes made a crucial error. He transitioned to a guillotine choke, but lost position and allowed McGregor to get back to his feet. From that moment on, everything seemed to land for the Irishman, as he took advantage of his eight-inch reach advantage and pounded Mendes with left hands from a distance.
UFC president Dana White declined to be specific on the trending pay-per-view buys, but said the card was one of the best in the company's history.
"I've been telling you guys all week this thing was trending bigger than anything we've ever done tonight," White said. "Tonight, on social media, crushed any fight we've ever done. It was a massive event and everybody delivered."
Attention now turns to the original matchup between Aldo, 28, and McGregor. ESPN.com ranks Aldo the No. 2 pound-for-pound fighter in the world behind Jon Jones.
UFC CEO Lorenzo Fertitta told ESPN.com the featherweight unification bout could take place on Jan. 2 in Las Vegas. The UFC already has the date reserved at the MGM.
"We've been in contact with [Aldo] and he's chomping at the bit," Fertitta said. "He wants to fight, obviously, as soon as possible. We need sufficient time to promote the event. Conor just had a tough fight; he'll need some time off.
"I'm thinking probably January 2, but that's not set in stone. We have a date at the MGM on January 2."
Fertitta said the fight could potentially land in December as well. The UFC has a pay-per-view event scheduled on Dec. 5, for which they have not yet announced a venue. Calgary and Las Vegas are currently being considered.
Audie Attar, McGregor's manager, echoed that time frame.
"Obviously, we would have preferred it to be tonight, but injuries happen," Attar said. "It's part of the sport. I would love to see it happen before the end of the year, December, or in January at some point. That makes sense in terms of giving Aldo time to recover and a full training camp so there's no excuses."
McGregor has long expressed an interest to headline a stadium show at Croke Park in Dublin, which holds a capacity of more than 80,000. Fertitta said that remains an option if McGregor defeats Aldo and defends the undisputed belt.
"This fight needs to happen before next summer and I don't think you can do a fight outdoors in Ireland in January; that doesn't work," Fertitta said. "If we have the right fight and it makes sense, we'd do it at Croke Park and it would be an afternoon pay-per-view back here in the U.S."
There had been some controversy regarding the severity of Aldo's rib injury prior to UFC 189. Andre Pederneiras, Aldo's trainer, publicly stated Aldo had suffered a fractured rib. The UFC released a statement shortly after news broke that Aldo had suffered a bone bruise and damaged cartilage, not a broken bone.
White refused to speak about Aldo on Saturday, saying his comments had been misrepresented in the media. Fertitta said multiple doctors the UFC consulted with regarding Aldo's scans diagnosed cartilage damage and not a broken rib, but said ultimately the exact severity of the injury doesn't matter.
"Aldo went and had an MRI," Fertitta said. "There were multiple doctors that looked at his scans and -- it's not as simple as looking at typical broken bones because there was cartilage involved -- he obviously was hurt. We are not questioning that at all. Whether it was a bruise or fracture is up for debate. Some doctors say yes [it was broken]. Some say no. All I know is that sometimes, bruises and hurt cartilage hurt worse than a fracture, so it doesn't really matter.
"Aldo has been a champion for 10 years. He's proven his worth -- proven he's tough as nails. That has never been in question. The fact of the matter is that he couldn't fight. It is what it is and we all move on and promote the next fight."