Spain are aiming to become the first side to win Olympic gold after lifting the Women's World Cup, having defeated England in the final of that tournament last year.
Ballon d'Or winner Bonmati levelled after Aoba Fujino's stunning 13th-minute free-kick opener in Nantes, before the Spain midfielder teed up Mariona Caldentey's winner 16 minutes from time.
That result saw Montserrat Tome's side seize top spot in Group C ahead of Brazil, who edged past Nigeria 1-0 thanks to Gabi Nunes' first-half finish.
Elsewhere in Group A, defending champions Canada put off-field issues to one side by overcoming New Zealand 2-1 thanks to goals from Cloe Lacasse and Evelyne Viens in Saint-Etienne.
Canada's integrity had been questioned ahead of the game in the wake of a spying scandal, with assistant Andy Spence serving as head coach after Bev Priestman volunteered to sit out.
Priestman, two members of her staff and the Canadian Olympic Committee are being investigated by FIFA's disciplinary committee after a drone was spotted flying over New Zealand's training on Monday.
"Obviously the timing was quite terrible," said Canada captain Jessie Fleming of the drone incident after her side battled back following Mackenzie Barry's early opener.
"But I think for us, we've just leaned into each other as a player group and we really just want to focus on being here and playing."
Hosts France seemed on course for a routine victory in the other Group A game after Marie-Antoinette Katoto's first-half double and Kadidiatou Diani's goal against Colombia.
However, Catalina Usme pulled one back from the spot and Manuela Pavi further reduced the deficit nine minutes later, only for Mayra Ramirez's late red card to help France hold out for a 3-2 victory.
Meanwhile, Germany swept aside Australia 3-0 in Group B, inflicting the Matildas' joint-heaviest defeat at the Olympics, along with a loss against the same opponent by the same scoreline, at Sydney 2000.
Efforts from Marina Hegering, Lea Schuller and Jule Brand sealed the victory for the DFB-Frauenteam against the Tokyo 2020 semi-finalists.
After being found guilty of using a drone to film opponents' training at this and past tournaments, the Tokyo champions had six points deducted, while head coach Bev Priestman has been banned from all football-related activity for one year.
The Canadian Soccer Association (CSA) are considering an appeal against the decision, but those controversies were put to one side when the team took to the field.
Starting the day bottom on -3 points, Canada, led by Andy Spence, had to come from behind to beat France after Marie-Antoinette Katoto put Les Bleues ahead just before half-time.
Jessie Fleming equalised from close range in the 58th minute, but Canada fought back, with Gilles getting some help from the woodwork to secure the win.
Meanwhile, Colombia's comfortable 2-0 victory over New Zealand means they now lead Group A after two games thanks to their goal difference.
Elsewhere, in Group C, Spain booked their place in the quarter-finals with a game to spare after a 1-0 win over Nigeria.
Alexia Putellas' long-range strike maintained La Roja's perfect start to the tournament as they bid to become the first team to win Olympic gold after lifting the Women's World Cup.
In the other group game, Japan ruined the party for Marta, who made her 200th appearance for Brazil in a shock 2-1 defeat.
Despite Mina Tanaka's penalty miss in the first half, Japan launched a comeback after Jheniffer's opener, with Saki Kumagai and Momoko Tanikawa both scoring in stoppage time to move second.
The game of the day came in Group B though, as Australia edged out Zambia in an 11-goal thriller.
Barbra Banda's hat-trick gave the minnows a 5-2 lead, but they could not hold onto it as Michelle Heyman made it 6-5 in the 90th minute to snatch a win.
The Brazil great narrowly missed Olga Carmona's head with an out-of-control attempt to reach the ball in first-half stoppage time, receiving a straight red card in what could turn out to be her final-ever Olympic game.
Brazil needed a win to secure a place in the knockout rounds, but now they face a nervous wait to see if they will be one of the two best third-place teams in the last eight – a match they would have to play without their captain.
Athenea del Castillo eventually got the breakthrough after 68 minutes, before Alexia Putellas scored in the 107th minute to ensure they stayed perfect to top the group.
It was a dominant performance by La Roja, who created an expected goals tally of 2.75 from 27 shots compared to Brazil's 0.3 from 10 efforts.
Spain will face the best third-place team from either Group A or B in the quarter-final on Saturday.
Meanwhile, Japan also secured a spot in the knockout rounds with an emphatic 3-1 victory over Nigeria.
Japan stunned Brazil in the second group game and continued their momentum by getting the job done in the first half.
Maika Hamano and Mina Tanaka put them 2-0 up before Jennifer Echegini pulled one back for Nigeria.
However, Hikaru Kitagawa's strike just before the break restored Japan's two-goal cushion and held onto that lead to set up a meeting with the winners of Group B in the next round.