Detroit received a conditional fourth-round pick in 2018 and a conditional third-round pick in 2019. According to Craig Custance of The Athletic, the Red Wings will also pay half of the goalie's $4.15 million salary.
Mrazek has appeared in 22 games this season, 18 starts, winning eight games with three shutouts.
The 26-year-old has posted a 2.89 goals-against average and .910 save percentage in 2017-18, his sixth campaign with Detroit. However, Jimmy Howard had once again become the top option in net for Detroit, making Mrazek expendable.
Mrazek is headed toward restricted free agency this offseason, per Spotrac.
The Flyers were in desperate need for a goaltender after Brian Elliott went down in mid-February with an injury that required core muscle surgery, which could keep him out five to six weeks. Michal Neuvirth then suffered a lower-body injury during Sunday's game against the New York Rangers, per Sam Carchidi of the Philadelphia Inquirer.
Alex Lyon was the top option remaining but only had four NHL games in his career.
Mrazek provides the team with an experienced player who served as the Red Wings' No. 1 option in each of the past two seasons. The Flyers are still in contention for the playoffs, with 70 points from their 59 games, but the deep Metropolitan Division could be difficult to survive, even with the latest addition.