Image copyright AFP Image caption Theresa Villiers said she was offered a role but it was "not one which I felt I could take on"

Theresa Villiers has said she is "sad" to end her work in Northern Ireland after quitting the government.

She was replaced as Northern Ireland secretary by James Brokenshire on Wednesday as Theresa May appointed her first cabinet.

Ms Villiers quit after turning down the new prime minister's offer of a non-cabinet post at the Home Office.

She was the third longest-serving Northern Ireland secretary, having held the portfolio since 2012.

"I believe that I leave the political situation there in a more stable position than it has been for many years." Ms Villiers said.

"I was able to to help tackle the crisis, which a year ago left us on the brink of a collapse of devolution and a return to direct rule."

But she said she was "confident that progress will continue to embed peace, stability and prosperity" in Northern Ireland.

"Northern Ireland and its people will always have a very special place in my heart," she said.

"I send my very best wishes to Northern Ireland's leaders as they continue the crucial process of implementing the two historic agreements that the cross-party talks I chaired were able to deliver."

Image copyright Harrison/PA Image caption Arlene Foster (pictured left with Irish Foreign Minister Charlie Flanagan and Deputy First Minister Martin McGuinness) said she "enjoyed working with" Mrs Villiers

First Minister Arlene Foster said she "enjoyed working with" Mrs Villiers and wished her "all the best for the future".

But Sinn Féin MEP Martina Anderson said Mrs Villiers "will be no loss".

"All British Secretary of States (sic) should stay over there," she tweeted.

Her party colleague John O'Dowd MLA said Ms Villiers "played a negative role in dealing with the legacy of the conflict" and had "placed obstacles in the path of families seeking access to truth".

Image copyright PA Image caption James Brokenshire worked closely with Theresa May in the Home Office

Irish Foreign Minister Charlie Flanagan, who worked closely with Ms Villiers during negotiations with the Stormont parties, said he "appreciated the effort and commitment she invested" in the role.

Ms Villiers confirmed her departure from the government in a post on Facebook.

She said Mrs May had been "kind enough to offer me a role" but added that it was "not one which I felt I could take on".

"I am very grateful to have been given the opportunity to serve on the front bench for 11 years," she added.