BBC Trust chairman Rona Fairhead wrote to the Welsh-language channel's authority chairman Huw Jones to confirm the arrangement on Wednesday.
S4C's current agreement runs to March 2017.
The trust had previously pledged to continue this year's level of funding to 2018.
In the letter, Ms Fairhead said it was "the right thing to do" in recognition of the "important role played by S4C for Welsh-speaking licence-fee payers".
Welsh Secretary Alun Cairns said he was delighted S4C's funding has been protected.
"Many organisations have worked hard to help secure this settlement, which will safeguard S4C's future for many years to come," he added.
"S4C plays an important role in Wales, cementing the Welsh language and culture within communities, and I will continue to do everything I can to ensure the channel's continued success."
Funding for S4C will remain at its current level of £74.5m a year until the end of the current licence fee agreement in 2022.