Cleveland Browns quarterback Teddy Bridgewater scored a touchdown with less than three minutes remaining to beat San Franciscans 21-9 on Saturday.
Bridgewater completed 6 of 7 passes for 79 yards and a touchdown, and the Browns overcame an early 2-0 deficit to keep the win alive.
Brees threw for 259 yards and two touchdowns in the first half, and he also ran for another touchdown.
The Browns were coming off a game against the Minnesota Vikings in which they scored just four points.
San Francisco quarterback Garrett Gilbert led the 49ers with 12 first-half touchdowns and five sacks, but the 49er defense held San Francisco to just two first-quarter points.
The Browns defense played well on the ground for most of the game, forcing five turnovers and forcing three fumbles, but they allowed four sacks.
Gilbert finished with five tackles, one sack and a forced fumble.
Brett Hundley threw for 193 yards and one touchdown.
He also ran out of bounds on two occasions.
The 49ers defense forced three turnovers and converted a third on a fake punt.
The Niners finished the game on the road, coming off an ugly loss to the Philadelphia Eagles.
The team lost its first four games and the first four matchups against the Browns.
The 49ers are 4-6 against the Cleveland Browns this season.
They lost in the season opener to the Arizona Cardinals.
The Eagles won that game.
The Eagles beat the 49ERS last season, 34-14.