The 49ers released Locke on Saturday, Matt Barrows of The Athletic Bay Area reports.
Bradley Pinion beat out Locke for the team's starting punter position. Locke will look for a practice squad role elsewhere.
Locke signed with the 49ers on Monday, Andrew Krammer of the Minneapolis Star Tribune reports.
Entering his sixth season in the league, Locke will look to make San Francisco a long-term home. The 28-year-old punted in just five games for the Lions last season, serving as a mid-season replacement.
The Lions released Locke on Tuesday, Dave Birkett of the Detroit Free Press reports.
The transaction signals that the Lions will activate Sam Martin (ankle) from the Non-Football/Injury list and have him available to punt in Sunday's game against the Steelers. Locke, who signed with the Lions in Week 2 after Martin's replacement, Kasey Redfern (knee), landed on injured reserve, ranks ninth in the NFL with 42.2 net yards per punt.
Locke was signed by the Lions on Tuesday, the Lions' official site reports.
With fellow punter Kasey Redfern (knee) heading to injured reserve, Locke will join the Lions and should immediately function as the team's top punter. The 27-year-old spent the first four years of his career with the Vikings, before starting the 2017 campaign with the Colts, though he was ultimately let go prior to the opener. For his career, Locke has averaged 43.2 yards per punt.
The Colts released Locke on Monday.
The Colts evidently weren't satisfied with Locke's performance during training camp, so look for the team to sign a free agent to handle punting duties before the preseason finale Thursday against the Bengals. The 27-year-old Locke had signed a two-year deal with the Colts in March following a four-season run with the Vikings, during which he averaged 43.2 yards per punt.
Locke signed a two-year, $2.7 million contract with the Colts on Friday, Kevin Bowen of the team's official site reports.
Locke heads to Indy after spending the past four seasons with the Vikings. He'll replace Pat McAfee, who retired a few weeks ago after eight seasons in the league.