Chris David scored a fine goal in added time to earn Fulham a final-day draw against Crystal Palace.

Dwight Gayle turned Joel Ward’s drive past David Stockdale from close range to put Tony Pulis’s visitors ahead just before the half-hour.

Cauley Woodrow curled in from Hugo Rodallega’s pass to pull the Cottagers level before Gayle scored a free-kick.

But David collected the ball near halfway and hit a looping shot in off the bar from 25 yards to secure a draw.

Fulham boss Felix Magath has promised to stay on following relegation to the Championship.

And, ahead of what is sure to be a summer of departures at Craven Cottage, the German will have been buoyed by the contributions of Woodrow, 19, and 21-year-old David.

Pulis, meanwhile, is set for talks with the Palace board about how to take the club forward, and 17 points from the last 24 available is a solid base to build from.

His side took control early on and deserved the advantage Gayle gave them after 27 minutes.

Yannick Bolasie, who had earlier had a decent effort turned wide by Stockdale, laid off for Ward.

The full-back’s powerful shot was flying straight at the goalkeeper but Gayle, making his first league start since Pulis took over in November, beat the offside trap to divert the ball in.

They went close to adding a second when Thomas Ince floated over a free-kick from the left and Scott Dann’s header was pushed away by Stockdale.

Goalkeeper Wayne Hennessey, making his first start since joining from Wolves in January, also showed his quality when he palmed away Fernando Amorebieta’s powerful header.

Fulham improved after the interval and, after a quick corner, debutant David’s cross was headed back across goal by Amorebieta and Rodallega’s header glanced the outside of the post.

They pulled level when Rodallega held off a crowd of defenders and laid off for Woodrow, who had a loan spell at Southend earlier this season, to curl home.

Palace restored their advantage when Gayle bent in a free-kick late on to add to the two goals he scored in the 3-3 draw with Liverpool on Monday.

The visitors could have added a third when Jason Puncheon broke and Glenn Whelan hit the bar before Gayle prodded the rebound wide.

But in the fourth minute of added time, Dutchman David’s powerful effort from distance meant Magath’s team avoided a 25th league defeat of the season.