WASHINGTON — Her image has been plastered on banners in Tahrir Square, crossed out with a blood-red X or distorted and smeared with insults. She is too cozy with Egypt’s deposed president and the Muslim Brotherhood, the signs say, and should leave the country.

Anne W. Patterson, a press-shy career diplomat who has been American ambassador to Cairo since 2011, suddenly finds herself a target in a dangerous political upheaval, a symbol for angry young Egyptians of America’s meddlesome role in their country’s affairs.

With the Egyptian military ousting President Mohamed Morsi on Wednesday, Ms. Patterson will have to navigate a perilous course between Mr. Morsi’s opponents and his enraged Islamist supporters, both of whom have grievances with the United States.

That she has become such a lightning rod for American policy speaks to the legacy of American involvement in Egypt and to the comparatively low level of attention Egypt has received from the Obama administration since the ouster of Hosni Mubarak two and a half years ago — at least until this week’s turmoil.