Natalya Sharina, who runs the Library of Ukrainian Literature, has been accused of inciting ethnic hatred.
Investigators say they found books by radical nationalist Ukrainian author Dmytro Korchynsky, whose works are banned in Russia.
The Ukrainian foreign ministry has protested against the search.
"This is not the first attempt by the Kremlin to label all things Ukrainian 'Russophobic' and 'extremist'," the ministry said in a statement.
"We call on the Russian authorities to halt pressure on the work of the library - a cultural centre of [the] Ukrainian community."
Russia's powerful Investigative Committee said a criminal case against Natalya Sharina had been opened and investigations were continuing.
Dmytro Korchynsky is a controversial Ukrainian nationalist who has helped to establish far-right political movements.
Relations between Russia and Ukraine are strained following Moscow's annexation of Crimea last year and its support for pro-Russian separatists in eastern Ukraine.
In another development on Thursday, Ukrainian forces and pro-Russian rebels have carried out an exchange of captured fighters.
The exchange, in the eastern Luhansk region, is said to have involved 11 rebels and nine government soldiers.
The BBC's David Stern in Kiev says it is a sign that a ceasefire introduced at the beginning of September continues to hold, and may be growing stronger.
Peace talks are continuing in the Belarusian capital, Minsk.
Russian investigators say they have detained the director of a Ukrainian library in Moscow after a search found "anti-Russian propaganda".