"Patrick is a player who can play anywhere in our lineup," Penguins general manager Jim Rutherford said in a statement. "He's a good two-way player, provides leadership and will be a good fit with our team."
In 2019, Marleau returned to the Sharks on a league-minimum $700,000 contract for a 20th season with the franchise, after spending two seasons with the Toronto Maple Leafs. The season hasn't gone the way he wanted, with injuries and ineffectiveness keeping the Sharks near the bottom of the West.
The Penguins are only two points behind the Washington Capitals for the lead in the tough Metro Division, and Marleau likely will fill a bottom-six role and try to win his first Stanley Cup.
If the Penguins win the Cup, the Sharks will get a second-round draft pick.
Marleau, 40, is the Sharks' franchise leader in games (1,551), goals (518) and points (1,102). He has 10 goals and 10 assists in 58 games this season.
"Patrick is one of the most iconic players to ever wear the Sharks uniform," Sharks GM Doug Wilson said in a statement. "Although we have had a disappointing season in San Jose, he deserves every opportunity to have a chance at winning a Stanley Cup, and we're happy to help accommodate that. We wish him the best of luck."
Marleau played for the Maple Leafs in 2017-18 and 2018-19, but his $6.25 million annual average salary was too much for the cap-strapped Leafs, who traded him to Carolina Hurricaneslast June. The Hurricanes made the move to net a first-round pick and then bought out the final year of Marleau's contract.
Marleau captained the Sharks from 2003 to 2009.
The Penguins visit the Sharks on Saturday night.
ESPN's Greg Wyshynski contributed to this report.
Why did the Sharks trade Marleau to the Penguins?
Greg Wyshynski and Emily Kaplan break down the Sharks trading Patrick Marleau to the Penguins.
Caps top Penguins with bizarre goal
Jakub Vrana forces in a goal in the first period, and Sidney Crosby scores in similar fashion in the second period. Washington beats Pittsburgh 5-3.