Their clash in the Gulf desert nation was characterised by hot, dusty wind that slowed down their exchanges but world number 42 Basilashvili bided his time to snatch the first set in a tiebreak.
Bautista Agut eased past Russia's Andrey Rublev, ranked eighth in the world and the defending champion, with a dominating performance, 6-3, 6-3
Federer underwent two knee surgeries last year and was playing his first tournament since a semi-final loss to Novak Djokovic at the Australian Open in January 2020.
Looking ahead, Federer also said that he had not taken decisions on tournaments before Wimbledon or the Tokyo Olympics but hinted that he would likely be at Roland Garros.
Qatar Open: Roger Federer squanders match point in second match after return, knocked out by Nikoloz Basilashvili
The 20-time Grand Slam title winner, who underwent two knee surgeries in 2020, secured the first set but eventually wilted and lost the quarter-final tie, 3-6, 6-1, 7-5.
What matters far more in the scheme of things than the result or the way it came about is that Federer cares about success and can conjure up what's necessary to find it.
"It's been a long and tough road for me," said Federer, who hasn't played a match since a semis defeat to Novak Djokovic at the Australian Open in January 2020, 405 days ago.
Federer hasn't played a match since his semis loss to Novak Djokovic at the Australian Open in January 2020 and joked with the umpire about the rules of the game at the start of his game against Dan Evans at Doha.
Roger Federer had two operations on his right knee since playing at the Australian Open last year.
'Retirement was never really on the cards,' says Roger Federer ahead of return from lengthy injury-forced break
Federer hasn't played a match since a semi-final defeat by Novak Djokovic at the Australian Open in January 2020 and acknowledged it was unusual for a player of his age to return after injury.
Qatar Open: Roger Federer pain-free ahead of return from injury, says retirement 'was never on the cards'
The 39-year-old hasn't played a match since a semi-final defeat to Novak Djokovic at the Australian Open in January 2020 and acknowledged it was unusual for a player of his age to return after injury.
The fourth-seeded Czech player needed just over an hour to see off Muguruza and claim her 28th career title.
The 39-year-old hasn't played a match since a semi-final defeat to Novak Djokovic at the Australian Open in January 2020.
Muguruza received a walkover into the title match after fellow former world number one Victoria Azarenka dropped out because of back pain
Qatar Open: Garbine Muruguza sets up Victoria Azarenka semi-final, Elina Svitolina, Karolina Pliskova eliminated
Azarenka, a two-time winner of the Australian Open in 2012 and 2013, reached the last four by seeing off Ukrainian top seed Elina Svitolina, 6-2, 6-4.
Sania and her Slovenian partner lost 5-7, 6-2, 5-10 to America's Nicole Melichar and Dutch player Demi Schuurs in one hour and 28 minutes.
Qatar Open: Former champions Karolina Pliskova, Petra Kvitova, Victoria Azarenka through to quarters
It was Jabeur who defeated the Czech during their last encounter in Doha in 2020 but this time it was 2017 Qatar champion Pliskova who booked her ticket to her first hard-court quarter-final since 2020 Dubai.
Keys hit 24 winners against 13 for the sixth-seeded Bencic, who was coming off a loss to Iga Swiatek in the final of the Adelaide International on Saturday.
Federer's withdrawal is a blow to organizers of the Miami tournament, who were forced to cancel last year's event as Covid-19 chaos left sport in North America at a standstill.
Despite conceding the first set, Russia's Kuznetsova put up a spirited defence in the second leading to increasingly sprawling rallies with her well-matched Belarusian opponent.