Warburton captained the British & Irish Lions to a historic series win over Australia in the summer and is happy to have signed up to the deal.
"I am delighted to commit my future to Welsh rugby," said Warburton.
WRU group chief executive Roger Lewis said: "We have been able to strike a deal which ensures the Welsh captain will continue to play his rugby at the highest level here in Wales.
"There can be no better message to current and future internationals than the decision of Sam Warburton to become the first senior player to sign a WRU national contract and commit to regional rugby and international rugby in Wales.
"This is all about us working together in the best interests of rugby in Wales and I am sure this will be remembered as an important moment for rugby in Wales."