Gagne hasn't scored a goal in 11 games this season for the defending Stanley Cup champions, who sent the veteran forward back to the city where he spent his first 10 NHL seasons.
Los Angeles will get a third-round pick if Philadelphia makes the playoffs or a fourth-round pick if the Flyers miss the postseason.
Gagne had 259 goals and 528 points in his decade with the Flyers, scoring a career-high 47 goals during the 2005-06 season. The Flyers traded him to Tampa Bay in 2010, and the Kings signed him a year later.
The seven-time 20-goal scorer was sidelined for more than five months of his first season in Los Angeles with his latest concussion, but returned to action in the Stanley Cup finals. He played four games while winning his first NHL championship.
Gagne's ice time was down sharply this season, and he had been a healthy scratch recently for the Kings (9-6-2), who have won four straight after a slow start. Gagne had five assists this season, but lost playing time recently to fellow veteran Dustin Penner.
Philadelphia also is off to a slow start at 9-11-1 despite scoring 60 goals, third-most in the Eastern Conference.
Gagne will be a free agent this summer.