On the night of March 25, 1945, some 300 Japanese soldiers launched a surprise attack on Airfield Number 2 on Iwo Jima. They were among the last of the 21,000-strong garrison that had fought tooth and nail for every inch of the island over the previous 35 days.

U.S. troops had captured the airfield early in the fighting, but an extensive tunnel network and nighttime maneuvers allowed the Japanese to carry out one final attack before their defeat.

A brutal 90-minute fight erupted as the Japanese charged into tents full of Army pilots, Marines, and Navy Seabees, stabbing or shooting them. U.S. reinforcements arrived and wiped out the attackers, but more than 100 Americans were killed and 200 wounded.

It was the end of the Battle for Iwo Jima, but the experience and massive casualties, along with those suffered at the following Battle of Okinawa, forced the U.S. to think twice about invading the Japanese mainland.

“The Doorkeeper to the Imperial capital”

Iwo Jima
Smoke clouds over Iwo Jima on the second day of naval and air bombardment, February 17, 1945. (PhotoQuest/Getty Images)

Despite having a surface area of just eight square miles and being 750 miles from mainland Japan, Iwo Jima was extremely important.

For the Japanese, it was sovereign territory, with one Japanese officer calling it “the doorkeeper to the Imperial capital.”

Its radar station also gave mainland Japan a two-hour warning of incoming B-29 raids, and its airfields allowed Japanese aircraft to intercept American bombers and launch their own raids on U.S. bases.

For the Allies, the island was important as an emergency landing strip, a base for fighter escorts, and a launchpad for future invasions.

Recognizing its importance, the Japanese spent nearly a year preparing for an invasion. Under Lt. Gen. Tadamichi Kuribayashi, the Japanese evacuated all civilians, burned any remaining vegetation for clear fields of fire, and constructed over 11 miles of bunkers and tunnels.

The defenses were deep and intricate — one installation inside Mt. Suribachi was seven stories underground. The bunkers and gun positions had interlocking fields of fire, and the tunnels were largely impervious to air and naval bombardment.

Kuribayashi’s goal was to lure the Americans into kill zones, destroying them with artillery, ambushes, and guerrilla tactics. He forbade frontal banzai charges and encouraged his men to kill 10 Americans for every one Japanese soldier.

“One of the Worst Blood-Lettings of the War”

Marines wounded Iwo Jima
Marines slide a blanket under a wounded corporal during fighting on Iwo Jima. (Hulton-Deutsch/Hulton-Deutsch Collection/Corbis via Getty Images)

Nearly 80,000 Marines were on hand for the invasion. They were supported by over 500 ships and hundreds of tanks and aircraft. They expected to take the island in a week.

After 10 weeks of aerial bombing and three days of naval bombardment, the first Marines landed at 8:59 a.m. on February 19. They were virtually unopposed at first, as Kuribayashi waited a full hour for the Americans to crowd the beaches before his 400 artillery pieces opened fire.

The effect was devastating. “It was one of the worst blood-lettings of the war,” recalled Maj. Frederick Karch, a veteran of the Marshall Islands, Saipan, and Tinian. “I just didn’t see how anybody could live through such heavy fire barrages.”

Iwo Jima’s soft volcanic ash was difficult to traverse, and many men and vehicles got bogged down. As Marines moved inland, they ran into Kuribayashi’s kill zones. After the bunkers would be cleared, Japanese soldiers would use their tunnels to reoccupy them and attack the Americans from the rear.

On this day in history: United States Marines raise the American flag atop Mt. Suribachi

Read Next: On this day in history: United States Marines raise the American flag atop Mt. Suribachi

By the end of the first day, the Marines had cut off the southern tip of the island but at the cost of 548 killed and 1,755 wounded.

A Brutal Slog

Iwo Jima 20
U.S. Marines of the 28th Regiment, 5th division, cheer and hold up their rifles after raising the American flag atop Mount Suribachi on Iwo Jima, February 23, 1945. (Associated Press)

On February 23, the Marines secured Mt. Suribachi, raising the American flag in what would become one of the war’s most iconic moments. Despite the celebrations, fighting would continue for another month. Three of the six flag-raisers would eventually be killed, as would the Marine cameraman who recorded the event.

The Marines then turned their full attention to the north of the island, where the fighting intensified. The Japanese targeted Navy medics in particular. Japanese soldiers would call for help in English and then shoot the medics as they approached.

Flamethrowers became the most effective weapons against the tunnels and bunkers. Toward the end of the battle, up to 10,000 gallons of napalm were being used every day. If a tunnel was too deep or too risky to enter, the Marines would seal it with explosives.

As March wore on, food, water, and ammunition became scarce for the Japanese, and their casualties mounted. Acting against orders, Capt. Samaji Inouye led a doomed 1,000-man banzai charge on the night of March 8. They killed 90 Marines and wounded 257 at the cost of 800 Japanese killed, including Inouye.

On March 16, the Marines declared the island secure, but many Japanese soldiers remained in the tunnels. Nevertheless, after the surprise attack on March 26, large-scale fighting was over.

A Costly Sign of the Future

Japan prisoners POW Iwo Jima
The first Japanese prisoners of war captured at Iwo Jima aboard a U.S. warship, February 1945. (FPG/Hulton Archive/Getty Images)

The battle ended with 6,821 Marines and Navy personnel killed, and some 19,000 wounded. For the first time, total American casualties outnumbered those of the Japanese.

Of the roughly 21,000 Japanese defenders, only 218 had surrendered by March 26. Some 3,000 holdouts remained in the tunnels. Over the next two months, U.S. soldiers killed 1,602 more Japanese soldiers and captured 867.

The last two Japanese holdouts didn’t surrender until January 6, 1949.

The rest of the Japanese garrison — including all five commanders — died from disease, starvation, suicide, or in combat. Kuribayashi was rumored to have led the final charge himself, but his body was never found.

Navy aircraft carrier Saratoga Okinawa
The crew of the USS Saratoga tries to get fires, caused by Japanese planes, under control, near Iwo Jima, 1945. (Corbis via Getty Images)

On the last day of the battle, U.S. Marines began combat operations around Okinawa, roughly halfway between Iwo Jima and mainland Japan. U.S. troops had already seen what Japanese resistance on Okinawa would be like.

On February 21, as Marines fought on Iwo Jima, 50 Japanese kamikaze aircraft attacked nearby U.S. aircraft carriers, sinking one, damaging two, and killing over 300. Kamikazes would sink dozens of U.S. warships and kill nearly 5,000 sailors during fighting around Okinawa.

Total American casualties at Okinawa during three months of fighting there would be nearly double those suffered at Iwo Jima. About 200,000 Japanese soldiers and civilians would die as well.

The fanatical resistance and extreme bloodshed in the fighting for the two islands, which were isolated from the Japanese mainland, convinced U.S. leaders that an invasion of the mainland itself would devolve into an unacceptable slaughter, ultimately leading to the decision to drop the atomic bombs instead.

This article was written by Benjamin Brimelow and originally published on Insider.