Mr Odinga arrived shortly before 3pm under heavy security but was denied entry into the premises.
A crowd gathered outside could be heard chanting "No Matiang'i, no peace!"
Minutes after Mr Odinga's arrival, Dr Matiang'i's legal team said that the former CS had been released.
Former Interior Cabinet Secretary Fred Matiang'i will be charged with conspiracy to commit a felony and publication of false information, his lawyers have said.
"The question is are they taking waziri to court? They said not today. What remains is that they will choose a day to present the charge sheet in court," his lawyer Danstan Omari said.