United States Attorney General for the Southern District of New York Preet Bharara speaks with reporters at Trump Tower, Wednesday, Nov. 30, 2016, in New York. AP Photo/Evan Vucci

Preet Bharara, the US attorney for the southern district of New York, told reporters that he agreed to stay on after meeting with Donald Trump.

"We had a good meeting," Bharara told reporters. "I said I would absolutely consider staying on. I agreed to stay on."

Bharara, a Democrat, said that Trump, as a New York City resident, was well aware of the "great work," Bharara had done since he had been appointed by Obama in 2009:

"The president-elect asked, presumably because he's a New Yorker and is aware of the great work that our office has done over the past seven years, asked to meet with me to discuss whether or not I'd be prepared to stay on as the United States attorney to do the work as we have done it, independently, without fear or favor for the last seven years."

Bharara also told reporters that he spoke with Senator Jeff Sessions — a Republican, and Trump's nominee for attorney general — who also asked Bharara to keep his job.

Bharara's position is particularly important as the five boroughs of New York City, along with many Wall Street banks, fall under his jurisdiction. During his time as US attorney he earned himself the nickname "the sheriff of Wall Street" for keeping big banks in check.

US attorneys are appointed by the president and are subject to Senate confirmation.