WARNING: The following contains spoilers for The Suicide Squad, now in theaters and streaming on HBO Max.

In The Suicide Squad, a lot of what motivates Amanda Waller's Task Force X is their hidden desire to be heroes. Sure, they're driven by self-preservation, but below the surface, they believe in each other and that they can make a difference. And this mindset leads to a bloody finale on Corto Maltese as Bloodsport (Idris Elba)'s crew tries to bring down Project Starfish, only for the plan to go off the rails after a massive betrayal.

RELATED: The Suicide Squad Sets Its Sights on a $30 Million Domestic Opening

Why Peacemaker Kills Rick Flag

The-Suicide-Squad-Peacemaker-Rick-Flag

The team rigs the ex-Nazi base, Jotunheim, with explosives to destroy Starro, the mind-controlling alien. However, it soon comes to light that the project was actually commissioned by America, who recovered the alien after it took over some astronauts. The U.S. didn't want experiments on local soil, though, so the Thinker (Peter Capaldi) has spent the last 30 years experimenting on men, women and children in Corto Maltese.

And with a coup taking place on the island nation, Amanda Waller (Viola Davis) sends the squad in to erase all evidence. The bombs go off early, however, freeing Starro, who quickly rips the Thinker apart. Amid the chaos, Rick Flag (Joel Kinnaman) is able to extract a drive with the information needed to expose America, but Peacemaker (John Cena) turns on him. It turns out Cena's character is Waller's contingency plan, and after a brawl, he stabs Flag to death before holding Ratcatcher (Daniela Melchior) at gunpoint in order to get the drive.

The Suicide Squad then cuts back a few minutes to reveal the bomb went off early because of the other half of the team on the higher levels. David Dastmalchian's Polka-Dot Man made a massive mistake when he tried to kill the soldiers coming after them, with his incinerating polka dots accidentally set off explosives dropped when Milton got killed, triggering the collapse of the concrete tower. The explosion leads to Bloodshot falling down a few levels, where he comes face to face with Peacemaker, seeing his ally ready to kill Ratcatcher. They fire at each other, but Bloodsport's smaller bullet shatters Peacemaker's and hits him in the throat. But while they're while able to recover the drive, a liberated Starro's rampaging through the city.

RELATED: James Gunn Decries Martin Scorsese's 'Awful Cynical' Marvel Film Criticism

The Suicide Squad Defies Waller and Stops Starro

he-Suicide-Squad-Harley-Quinn-Starro

Waller lost communication with the team earlier in the movie, but with Jotunheim gone, they're up again, and she orders Task Force X to leave. However, Bloodsport can't walk away and he turns back, ready to do his best to save the people of Corto Maltese. He quickly formulates a plan that sees Polka-Dot man incinerate Starro's feet, King Shark attempt to eat the creature and Harley use her new weapon, a javelin, to kill the alien. It doesn't go according to plan, of course, and Polka-Dot Man gets killed, but Bloodsport saves Ratcatcher from getting crushed, which allows her to summon an army of rats that swarms Starro and devours it from the inside.

RELATED: Does Review-Bombing Films Actually Work? (Spoiler: Not Really)

Bloodsport Blackmails Amanda Waller

A lot of the credit has to go to Waller's team back at base, however, because Flo (Tinashe Kajese) knocked out her boss just as she was about to trigger Task Force X's explosives for disobeying orders. And when Waller's come to, Bloodsport sends her footage from the drive and makes it clear it's in a digitally secured cloud. He then bargains for the team's safety and warns Waller about threatening his daughter again.

Waller agrees to let them go and extracts the squad, and with Corto Maltese a democracy again, the film ends with Harley bonding with Bloodsport after losing friends. Aboard the plane, the team falls asleep, with the exception of Bloodsport, who bonds with Sebastian, Ratcatcher's rat, confirming he's gotten over his phobia and is ready to be a team player.

To see how Task Force defeats Starro, The Suicide Squad is in theaters now and streaming on HBO Max.

KEEP READING: John Cena Credits The Rock for Paving the Way for His Suicide Squad Role