Had the game Sunday been a movie, the ending would have been too unbelievably cruel.

Had it been a book, readers would have slammed it shut and rolled their eyes.

It was one thing for the Bears to lose 16-15 to the Eagles in an NFC wild-card playoff game. But like this?

Cody Parkey, who hit the uprights an astounding five times during the regular season, did it again when he missed a potential game-winning 43-yard field goal with 10 seconds left at a stunned Soldier Field.

Amazingly, the ball — which was nicked by Eagles defensive tackle Treyvon Hester — hit the left upright, then the crossbar before landing in the end zone like a grenade.

‘‘You can’t make this up,’’ Parkey said.

Parkey, who was booed off the field, actually made the kick seconds earlier, but Eagles coach Doug Pederson had called a timeout before the snap to ice him. Parkey said he hit the ball well and was trying to play a left-to-right wind.

Parkey hit the uprights a whopping four times Nov. 11 against the Lions, then began his routine of traveling to Soldier Field for practice. He made eight consecutive field goals after that disaster of a day but had been inconsistent recently, hitting an upright on an extra point in the regular-season finale.

And now this.

‘‘I don’t think you can write that story,’’ Bears coach Matt Nagy said. ‘‘Just with how things went this year, how he rebounded, then for that to happen. It’s tough. It’s hard for all the players. It’s hard for him. It’s hard for everybody. It stinks.’’

Like that, the Bears’ magical season — a 12-4 regular-season record, an NFC North title and their first playoff appearance in eight years — is over.

‘‘It’s like you’re running on a treadmill, then — boom! — somebody just pressed stop,’’ cornerback Prince Amukamara said. ‘‘That’s how we’re all feeling.’’

‘‘I need another quarter, or something,’’ running back Tarik Cohen said.

RELATED

• Bears’ season ends the way it was meant to — with Cody Parkey hitting an upright

• Bears QB Mitch Trubisky’s first playoff game should be remembered as a good one

Inside linebacker Danny Trevathan wasn’t ready to leave the locker room almost an hour after the game ended.

‘‘We were not ready to go home,’’ he said.

But they are going home. And it wasn’t all Parkey’s fault.

At halftime, quarterback Mitch Trubisky had a 68.2 passer rating. The Bears had only six points — on field goals of 36 and 29 yards by Parkey — but led by three.

The Bears’ vaunted defense allowed two touchdowns — as many as they had in the previous four games combined.

The Eagles’ first touchdown came on their first possession of the second half. The drive was kept alive by a third-down penalty for unnecessary roughness on safety Adrian Amos for hitting defenseless tight end Zach Ertz. It was only the fourth penalty of Amos’ four-year career.

The Eagles converted another third down before drawing a 33-yard pass-interference penalty on cornerback Prince Amukamara that gave them the ball at the Bears’ 10. On the next play, quarterback Nick Foles found tight end Dallas Goedert for a touchdown that gave the Eagles a 10-6 lead.

Then at the biggest point of the game, the Bears’ vaunted defense let the Eagles march downfield for a go-ahead touchdown.

After a shanked punt by Pat O’Donnell, the Eagles, trailing 15-10, got the ball at their 40 with 4:48 left. It took them six plays to get to the Bears’ 14 by the two-minute warning. On third-and-nine from the 13, Foles threw an 11-yard pass to former Bears receiver Alshon Jeffery for a first down at the 2.

The Bears stuffed the next three plays — two runs by Darren Sproles and an incompletion to Jeffery — to set up fourth-and-goal from the 2. The Eagles called a timeout before Foles threw the go-ahead touchdown pass to Golden Tate with 56 seconds left. Their two-point conversion failed, and they led by one.

Cohen caught the ensuing kickoff at the 7 and returned it 35 yards to the 42. Two plays later, Trubisky (26-for-43 for 303 yards and a touchdown) threw a 25-yard pass to receiver Allen Robinson, who was tackled at the

Eagles’ 33 with 35 seconds left.

Robinson, who caught a 22-yard touchdown pass from Trubisky with just more than nine minutes left, then caught an eight-yard pass. After a spike and a shot into the end zone, the Bears lined up for Parkey’s field-goal try.

‘‘You don’t like the outcome,’’ defensive end Akiem Hicks. ‘‘I’m sure our fans don’t like the outcome. Everybody in our building is frustrated with the outcome. We have one choice, though: Either you just sit here and mope about it, or you start making plans for your future, start making plans for your next season.’’