Armed men wearing the black uniform of the Department of State Security (DSS) stood at the gates of the building in the capital Abuja and were later joined by police officers, witnesses said.
Images of the blockade were shared widely on social media.
A spokesman for Vice President Yemi Osinbajo said in comments on Twitter that DSS head Lawal Musa Daura had been fired. Osinbajo is acting president for Muhammadu Buhari, who is out of the country on holiday, Presstv reported.
"The unlawful act, which was done without the knowledge of the presidency, is condemnable and completely unacceptable," said a statement issued later by Osinbajo's office.
It described the move as an "unauthorized takeover of the National Assembly complex" which was "a gross violation of constitutional order, rule of law and all accepted notions of law and order."
The statement gave no reason for Daura's dismissal.
The blockade came amid heightened tensions between lawmakers and the presidency. A raft of parliamentarians have quit Buhari's ruling party over the last few weeks and joined the main opposition.
Buhari plans to seek a second term in the February 2019 presidential vote but the loss of influential figures and divisions within his party could cost him support from powerful patronage networks and among voters.