Spencer, who only turned 15 this month, was strongly linked with moves to Manchester City and Middlesbrough, the town in which he grew up and most recently resided.
However, it is at Leeds where the England youth international, who has a Norwegian mother, will spend the foreseeable future.
"Absolutely delighted to have signed my first contract at Leeds United", Spencer posted on Thursday evening. "Thank you to everyone who has helped me along the way. Hard work starts now!"
Ian Harte, the football agent who played as a left-back for both Leeds and Sunderland, is among those who have congratulated Spencer on Instagram.
A report in The Sun last month suggested Sunderland would be due around £200,000 in compensation from Manchester City, should Spencer move there.
However, the player's mother later told the Norwegian broadcaster, TV2, that he was set to reject the Premier League champions in favour of Middlesbrough.
Have Leeds pulled off a coup with the Sunderland youngster?
Have something to tell us about this article?