Jameis Winston threw for 312 yards and two touchdowns, and the Tampa Bay defense corralled the San Francisco offense to beat the 49ers 27-9 on Sunday at Raymond James Stadium in Tampa, Fla.
"Jameis wasn't perfect but he played a damn good game," Buccaneers head coach Dirk Koetter said. "I'm proud of him. It's been a difficult road and he sees what that looks like and he needs to consistently play like that and he can be one of the best."
Winston, who was reinstated as the Bucs' starting quarterback, found tight end Cameron Brate from 6 yards out as Tampa Bay (4-7) struck first.
Tampa's beleaguered quarterback closed the scoring with a 28-yard strike to Adam Humphries early in the fourth.
In between those touchdowns, Cairo Santos connected on two field goals from 41 yards and 39 yards, and running back Peyton Barber found paydirt from 2 yards out as the Buccaneers outgained the 49ers, 412-342.
Winston finished 29-of-38 passing with a passer rating of 117.4.
"We played great football," Winston said after making his first start since Week 8. "When you execute and you protect the football and you get turnovers on defense, that's how you lead to a win."
Before the game started, the 49ers (2-9) made news when they announced inside linebacker Reuben Foster was being released.
On Saturday night, Foster was arrested in Tampa, Fla., on first-degree misdemeanor domestic violence at the Grand Hyatt Tampa Bay.
"It's extremely disappointing for me, for Kyle [Shanahan], for ownership, for everybody in here," 49ers general manager John Lynch told reporters Sunday. "We care a lot about Reuben and I can tell you it's a situation where we laid out some very specific ground rules for Reuben, as we do for all our players."
Lynch acknowledged the team still had to play a game and be in the right mental state.
"Today we have a game to play and I think our guys are in a good frame of mind to go do that," Lynch told reporters. "I'm excited to watch this game."
Once they took the field, the 49ers were sluggish on offense -- running only 11 plays in their first three possessions.
But the fourth time they had the ball, quarterback Nick Mullens mounted a scoring drive when he found Dante Pettis for a 13-yard score. That would be San Francisco's only touchdown of the day.
Robbie Gould's extra-point attempt hit the right upright and was no good.
It looked like the 49ers had a chance to tie the game after Jeff Wilson ran nine yards for a touchdown on San Francisco's first possession of the second half. But a replay showed he stepped out at the 1-yard line.
Matt Breida got stuffed on second-and-goal and Mullens was stopped short on third down. A false start by tight end George Kittle derailed any thought of the 49ers going for it on fourth down.
Gould's field goal from 23 yards made it 13-9.
Winston quickly answered with a six-play, 75-yard scoring drive. A 34-yard pass to Mike Evans and a 23-yard pass interference call set up Barber's 2-yard plunge and a 20-3 Tampa lead.
After forcing the 49ers to punt, Winston drove the Buccaneers on a game-clinching, 85-yard drive.
Mullens struggled, completing 18-of-32 pass attempts for 221 yards, one touchdown and two interceptions against one of the league's worst defenses. He was also sacked four times.
The Foster saga hung over the 49ers all day, even though 49ers head coach Kyle Shanahan said he addressed the "elephant in the room" with players when they woke up Sunday morning.
"Not at all," Shanahan said when asked if the decision to release Foster impacted the game plan. "He wasn't going to play anyway."
Shanahan indicated it was not a difficult decision and Foster "put us in a bad light. No one person is bigger than the team. We had a job today."
Shanahan was disappointed at the outcome of the game, especially with turnovers and going 1-for-8 on third downs.
"Our defense gave us a change. But we had too many penalties on special teams," Shanahan said.