WASHINGTON — Rick Santorum won the Alabama and Mississippi Republican presidential primaries last night despite being massively outspent by rival Mitt Romney and savaged on the airwaves with attack ads.

The Southern victories guaranteed that the race for the Republican presidential nomination will continue to be a grueling marathon between Santorum and Romney.

“We did it again!” Santorum declared to screaming supporters at his victory party in Lafayette, La., the next Southern state to vote, on March 24.

Santorum convincingly won Alabama with 35 percent of the vote to 29 for Newt Gingrich and Romney and 5 for Ron Paul.

Mississippi was more of a squeaker, with 33 percent of the vote to Santorum, 31 for Gingrich, 30 for Romney and 4 for Paul.

The battle for the South represented a defining moment in the race to become the GOP standard-bearer. Delegate leader Romney had jockeyed to clear an unobstructed path to the nomination, and Santorum tried to elbow out Gingrich and make it a virtual two-man race with Romney.

Texas Rep. Paul, who has yet to win a state and trails far behind his rivals in the delegate count, hardly campaigned at all in either Alabama or Mississippi.

Santorum’s wins delivered a painful blow to Romney, who had hoped to put to rest doubts about his ability to appeal to evangelical Christians and very conservative Southerners.

Santorum, who boasts that he’s the only “true conservative” in the race, has made his popularity with those very voters the cornerstone of his campaign.

He trails Romney 474 to 228 in delegates, but insists he can still win at the party’s August convention in Tampa.

“We are campaigning everywhere there are delegates because we are going to win this nomination,” he told the Louisiana crowd.

“You do your job next week, we will nominate a conservative and if we nominate a conservative we will defeat Barack Obama.”

Romney released a statement downplaying the losses. He pulled out an expected win in Hawaii, taking 45 percent of the vote over Santorum’s 25 percent. Texas Rep. Ron Paul came in third, with 19 percent, and Newt Gingrich trailed at just 11 percent.

“With the delegates won tonight, we are even closer to the nomination. Our campaign is on the move and ready to take on President Obama in the fall,” Romney said.

Alabama and Mississippi were expected to be a last stand for Gingrich, who before yesterday had won just two states — South Carolina and his home state of Georgia, which borders Alabama. He lost both states up for grabs yesterday.

But a defiant Gingrich said he would stay in the race to try to deny Romney the 1,144 delegates needed to secure the nomination.

“If you’re the front-runner and you keep coming in third, you’re not much of a front-runner,” Gingrich told supporters in Birmingham, Ala.