Swedish medieval law stated that the thing could elect, but also depose a King.
Svearna äga taga konung och likaså vräka. (Swedes own to take king and so also oust) is one of the texts in the Västgötalagen, a surviving handwriting of collected local laws in Västergötland from around 1220. It is interesting that it is the people of Svealand, not Östergötland or Västergötland who elect and depose a King, and the other two can only confirm or deny it.
Pope Gregory VII (c.1015/1025-1085, pope from 1073) claimed that the Papacy had the power to depose monarchs and used his power to declare the Western Emperor Henry IV. Gregory was slightly stretching with his claims to have this power and it didn't exactly remove Henry from his position. The overall conflict this was a part of, though, did basically throw all of what is modern day Germany into civil war. Somebody with a better general political knowledge of the Middle Ages could comment better on the overall conflict as well as whether this power continued to be exercised by later popes.
I.S. Robinson is the lecturer in my department who specializes on the investiture conflict and he has two books related to it: Henry IV of German 1056-1106 and The Papacy, 1073-1198: Continuity and Innovation. I haven't read them but I've listened to him lecture on the subject and it's pretty interesting, heavy on the contemporary theology though.