Rees, who joined Leeds at the start of last season from Bristol, has 11 caps for England and had a year to run on his previous deal before agreeing a new contract.
Director of Rugby Phil Davies said, "I'm delighted we have reached this new agreement and I look forward to seeing David progress this season. He impressed everyone at Leeds last season with his attitude despite having an injury set back. Hopefully with a good off season we can see the best of him in the coming two years."
Rees, who has previously played for Sale, added, "I've really been enjoying myself here. I feel my rugby has come on a lot with the coaching staff we have and the whole set-up. I hope I can further develop as a player and achieve a lot more over these next two seasons. With the players we've signed over the summer I think we can and I'm really looking forward to the campaign."
The Tykes have just finished their first week of full pre-season training ahead of their first pre-season game against Glasgow on Friday 13th August at Headingley, kick off 8pm. The Zurich Premiership season begins with the game against Gloucester on Sunday 5th September, kick off 2.30pm.
They have been drawn with tough French outfit Grenoble in Round 1 of the European Challenge Cup. The first leg takes place at Headingly on the weekend of 29 October, with the return leg taking place two weeks later.