Meanwhile, City's loss brought to an end its 100 percent home record in the league, and left leader Liverpool four points clear at the top after 18 rounds.
In another upset, former England striker Jamie Vardy scored to guide Leicester to a 1-0 victory at Stamford Bridge and inflict on fourth-placed Chelsea its first loss at home, also.
Arsenal drew level on points with Chelsea after easing past Burnley 3-1.
Southampton won for the second successive match under new coach Ralph Hasenhuttl when it defeated Huddersfield 3-1, while Watford ended West Ham's run of four consecutive victories by winning at London Stadium 2-0.
Bournemouth beat Brighton 2-0, and Newcastle's home game with Fulham ended 0-0.
UNITED BACK ON SONG
Manchester United's often ponderous style was one of the reasons Mourinho was fired. Solskjaer promised more attacking intent upon his appointment and the former Norway forward was as good as his word as his new team romped to victory at Cardiff.
Former captain Wayne Rooney summed up the drastic change of mood at United when he said, "The players obviously looked a bit restricted (before). The players have ability and today we've seen that. A lot of things were happening around the team and around the manager, which isn't good.
"Ole's given them that freedom," he told BT Sport. "It's a fantastic day for the club."
Jesse Lingard struck two goals, one a penalty, while Marcus Rashford, Ander Herrera, and Anthony Martial were also on target for the visitors.
Victor Camarasa replied with a penalty for Cardiff.
United was still in sixth place but Chelsea's defeat means the Old Trafford club was only eight points off the Champions League qualifying positions.
TOWNSEND SCORCHER
Palace forward Andros Townsend scored one of the goals of the season as Palace won at Manchester City for the first time in 28 years.
Ilkay Gundogan headed the home team in front before Jeffrey Schlupp equalized.
Townsend then turned the match on its head in spectacular fashion when the ball dropped invitingly toward the former England international 30 meters out, and he met it with a ferocious volley that flew into the roof of the net.
Luka Milivojevic made it 3-1 for Palace with a 51st-minute penalty.
Kevin De Bruyne pulled one back late on but it proved too little, too late for City.
"Palace had three shots on target and scored three goals," City coach Pep Guardiola said. "Football is like this."
Roy Hodgson's mood was rather different after his Palace side climbed to 14th place.
"You don't produce that sort of performance by waving a magic wand or having a five-minute team talk, there's a lot of work that goes into that structure and we were excellent," Hodgson said.
"We are playing against a team with enormous skill levels and their focus, their ability to sustain attacks, is an example to us all."
BRIDGE OF SIGHS
Leicester won at Chelsea for the first time in 18 years thanks to Vardy's sixth goal of the season.
A run of two victories in 12 games led to media speculation that Claude Puel's job as Leicester manager was in jeopardy.
Vardy said on Friday that Puel's patient playing style did not suit him but his goal showed the value of having a top striker in the team. The Stamford Bridge crowd was left stunned in the 51st minute when Ricardo Pereira made a strong run down the right before finding James Maddison and he set up Vardy.
OTHER RESULTS
Pierre-Emerick Aubameyang scored twice and Alex Iwobi also struck in Arsenal's win over Burnley.
Troy Deeney's penalty and a goal from Gerard Deulofeu steered Watford past West Ham.
Nathan Redmond, Danny Ings, and Michael Obafemi netted in Southampton's win at Huddersfield.
Wales international David Brooks scored twice in Bournemouth's win against Brighton, for which captain Lewis Dunk was sent off in the 73rd minute for two yellow cards.
- AP