A fourth-round choice in 2004, Sopoaga agreed to a five-year, $20 million deal, which is the market price set by Cowboys defensive tackle Jeremiah Ratliff and Raiders defensive tackle
Terdell Sands over the past year. His agent, Ken Zuckerman, confirmed the signing.
Last year, the 49ers signed nose tackle Aubrayo Franklin and he started 11 games. But if Sopoaga, who was scheduled to become a free agent Friday, had left, Franklin would have been the only defensive lineman remaining who started a game in 2007. Defensive end
Bryant Young is retiring and defensive end Marques Douglas is expected to leave in free agency. Each started 16 games last season.
The 49ers also announced the re-signing of linebacker Roderick Green, who is used as a rusher in passing situations.
Green has spent parts of the last two seasons with the 49ers. He had 4½ sacks for San Francisco in 2006, but was cut in last year's training camp before re-signing in early November for the last seven games of the Niners' fifth consecutive losing season.
Green, who had two sacks last year, spent his first two NFL season with the Baltimore Ravens.
Senior writer John Clayton covers the NFL for ESPN.com. Information from The Associated Press was used in this report.