Protesters from the N.A.A.C.P., including its national president, were arrested on Tuesday after an hourslong sit-in at the Mobile, Ala., office of Senator Jeff Sessions, where they demanded that he withdraw his name from consideration as President-elect Donald J. Trump’s attorney general.

Almost two dozen civil rights activists occupied the office around 11 a.m. to denounce what they called the senator’s “hostile” attitude toward civil rights and the Voting Rights Act, which was weakened by a Supreme Court decision in 2013.

The sit-in ended shortly after 6:30 p.m. when the protesters refused an order from the building’s management to leave the premises. It was not immediately clear how many people had been arrested, but a live-stream broadcast on Facebook by Lee Hedgepeth, a local journalist, showed at least six people agreeing to be arrested and kneeling before the police in prayer.