The future of an "exceptional" period drama that fans have hailed "the best of the BBC" has finally been confirmed.