Acting US Homeland Security Secretary Chad Wolf is stepping down from his post, days after criticising President Donald Trump over the riot at the Capitol. Mr Wolf said he was resigning over “recent events,” including court rulings saying he was not lawfully appointed to the post. He declared in a message to staff that he would step down at 11.59pm Monday, though he earlier said he planned to remain in his job. “These events and concerns increasingly serve to divert attention and resources away from the important work of the department in this critical time of a transition of power,” he said in a message to Department of Homeland Security employees. Pete Gaynor, who ran the Federal Emergency Management Agency, will become acting homeland security secretary, Mr Wolf said. The resignation comes a day before Mr Trump is set to visit the Mexican border wall. Last week, Mr Wolf asked Mr Trump and all elected officials to “strongly condemn the violence” that took place at the Capitol. Five people died, including a US Capitol police officer. Mr Wolf said he condemned violence on both sides of the political aisle, specifically that directed at law enforcement. “We now see some supporters of the president using violence as a means to achieve political ends,” he said, calling it unacceptable. Mr Wolf’s sudden departure adds to the chaos and confusion surrounding federal and state security preparations for the inauguration. The Homeland Security Department plays a critical role in securing the inauguration and assisting state and local officials in times of crisis. The FBI has learnt of plans for armed protests at state capitals, beginning on January 16, and in Washington, starting on January 17.