In the span of a remarkable four hours Tuesday, Miami’s front office landed its No. 1 priority, Steelers receiver Mike Wallace — and then just kept on going.

The Dolphins also added linebackers Dannell Ellerbe and Philip Wheeler and re-signed safety Chris Clemons, a massive commitment of resources and a drastic change in direction for the franchise.

As recently as January, owner Stephen Ross said he wanted to build through the draft. But in the first four hours of free agency, Ireland revamped an already stout defense and gave Ryan Tannehill the downfield threat he needs.

Premium content for only $0.99

The Dolphins, meanwhile, said goodbye to linebackers Karlos Dansby and Kevin Burnett — who they cut after signing Ellerbe and Wheeler. Tight end Anthony Fasano is also gone, agreeing to a deal with the Chiefs.

The Dolphins officially announced the Wallace and Clemons signings just after 10 p.m. Tuesday. News of the other moves came via league sources.

“We are pleased to reach an agreement with Mike Wallace,” Ireland said in the prepared statement. “He has a unique skill set which we believe will be a welcomed addition to our offense. We are looking forward to his contributions to the team.”

Earlier in the night, the organization posted on Twitter, “What a day. More to come...”

The remarkable thing is, the Dolphins still have the resources to follow through on that promise. Even after their flurry of moves, it’s estimated the team has more than $20 million of remaining cap space.

Landing Wallace alone would have been a coup.

He had been atop the team’s wish list since the season ended, and Ireland wasted no time in locking him down with a five-year contract worth an estimated $60 million.

Wallace will be the third-highest-paid wide receiver in the NFL behind Detroit’s Calvin Johnson and Arizona’s Larry Fitzgerald, according to a person familiar with the deal.

The agreement was reached with breathtaking speed; the terms were leaked just minutes after the 4 p.m. start of free agency, and Wallace took a physical shortly thereafter.

He’s been in Miami for the past week, The Miami Herald learned, but Dolphins sources emphatically denied the team visited with Wallace before the permitted time.

Wallace, who has 32 touchdowns catches in four seasons, was coveted for his 4.3 speed. Word of his arrival spread even faster.

Related stories from Miami Herald

“This really is exciting,” said Dolphins guard Richie Incognito, a Pro Bowler in 2012. “To have [Brian] Hartline back too, I think we’re really going to be a vertical threat.”

After addressing offense, Ireland quickly changed gears to defense. First up was Ellerbe, a middle linebacker coming off a breakout season, who agreed to a five-year, $34.75 million contract, according to a league source.

Some Ravens officials actually saw him as more of an indispensible part of their defense than Ray Lewis in 2012. And here’s why: Ellerbe, 27, had 92 tackles and 4.5 sacks.

In the end, he was younger and cheaper than Dansby, who would have counted $8.5 million against the cap. While the Dolphins quietly shopped Dansby in recent days, they found no suitors. Dansby did not return calls placed by the Miami Herald.

“I’m goin[g] to miss one of our defensive leaders,” defensive tackle Randy Starks wrote on Twitter.

Burnett also didn’t return messages Tuesday.

By cutting him, the Dolphins got a cap savings of $3.2 million — which presumably went to Wheeler, who signed a five-year deal worth $26 million, according to Pro Football Talk.

Wheeler, 28, spent his first four years in Indianapolis before joining Oakland in 2012.

He had career highs in tackles (109), sacks (3) and passes defensed (6).

Combined, the moves signaled a change in direction for the Dolphins defense, looking to go younger and faster — and perhaps better equipped to cover the Patriots’ dangerous tight ends.

Meanwhile, the Dolphins re-signed Clemons to a one-year deal, the terms of which were not immediately available. Clemons started all 16 games last year, recording 98 tackles and two interceptions.

In other Dolphins news, Miami remains in the running for Rams wide receiver Brandon Gibson, who is expected to visit the Jets first.

The Dolphins did make a run at tight end Jared Cook Tuesday, but he ultimately agreed to terms with the Rams. The team is believed to have interest in former Raider Brandon Myers, and the Jets’ Dustin Keller would be a logical fit too.

Miami also has holes at tackle and cornerback, but conceivably could re-sign their own to fill them. Jake Long left for a visit with the Rams on Tuesday, while three teams had interest in Sean Smith, according to a league source.

If neither Long nor Smith command contracts they expect, both could potentially return to Miami.

That is likely not the case for Reggie Bush, who is said to be in high demand. His first visit is with the Lions.