TAMPA — Mike Smith is out as defensive coordinator of the Tampa Bay Buccaneers, replaced by linebackers coach Mark Duffner.

Riding a three-game losing streak and not showing any signs of being able to fix a porous unit that keeps undermining the team’s chances of winning, the Bucs dismissed the former Atlanta Falcons coach Monday after yielding 92 points in the first half of consecutive losses to Pittsburgh, Chicago and Atlanta.

Tampa Bay, which has the NFL’s second-ranked offense and No. 1 passing attack, rallied to make two of those games close, however pressure on coach Dirk Koetter to make a change had been mounting since Mitchell Trubisky threw a career-best six touchdown passes in the Bears’ 48-10 rout of the Bucs on Sept. 30.

The day after the loss to Chicago, Koetter said he had no intentions of dismissing Smith because the defensive woes were not the fault of any one person.

The Bucs had a bye after that game, but having an extra week to prepare for Atlanta didn’t turn out to be an advantage. The Falcons gained 219 yards and scored touchdowns on their first three possessions to open a 21-6 lead before holding on late for a 34-29 victory that apparently sealed Smith’s fate.

“I have the utmost respect for Mike Smith as a man and as a football coach,” Koetter said. “These decisions are always difficult, but our top priority here is to ensure that we do everything possible to help this team succeed.”

Through five games, the Bucs (2-3) are 31st in total defense at 439.8 yards per game. They’re last in pass defense (355.6), while also allowing a league-high 34.6 points per game.

Opponents have scored 30 or more points four times, including 40-plus twice.

“I thought it was important that both sides of the ball be able to go through the self-scouting process during the bye week to see if we could make some adjustments that would help us play better as a football team,” Koetter said, explaining the decision to keep Smith after the loss to Chicago.

“I do think we had a good plan on defense for Atlanta. We did a lot of things we planned to do. We did some things differently. It just didn’t work out that way,” Koetter added. “This is a production business. We have to play better on defense. We have to play better as a football team.”

Smith coached the Falcons from 2008 to 2014. He sat out a year after being fired in Atlanta, where Koetter served as his offensive coordinator, and joined the Bucs when Koetter succeeded Lovie Smith as Bucs coach after the 2015 season.

“Mike and I worked together as coordinators in Jacksonville, and I worked for Mike in Atlanta. I didn’t ever see this day coming, but it’s here. We have to make decisions that give us the best chance moving forward. That’s all you can do,” Koetter said.

“It’s a tough business,” linebacker Lavonte David said, adding Smith was a “standup guy” who “never threw anyone under the bus.”

“Everybody in the locker room had a lot of respect for him,” David said. “It’s a tough situation he was in.”

Duffner, 65, was the logical choice as a mid-season replacement for Smith, primarily because of his experience. He’s in his 22nd season as an NFL assistant, third with the Bucs.

Duffner has also coached in Miami, Jacksonville, Green Bay and Cincinnati, where he was defensive coordinator for two years.

“When you change five games into the season ... it’s not like you’re going through a whole lot of options,” Koetter said. “Duff has been a coordinator is this league. He’s the most experienced coach on our staff, period, at any position.”