The Ministry of Public Security (Polish: Ministerstwo Bezpieczeństwa Publicznego), commonly known as UB or later SB, was the secret police, intelligence and counter-espionage agency operating in Polish People's Republic, which closely resembled the East German Stasi and Soviet KGB. From 1945 to 1954 it was known as the Department of Security (UB), and from 1956 to 1990 as the Security Service (SB).
The initial UB was headed by Public Security General Stanisław Radkiewicz and supervised by Jakub Berman of the Polish Politburo. The main goal of the Department of Security was the swift eradication of the anti-communist structures and socio-political base of the Polish Underground State, as well as the persecution of former underground soldiers of the Home Army (Armia Krajowa) and later anti-communist organizations like Freedom and Independence (WiN).
The Ministry of Public Security was established on 1 January 1945 and ceased operations on 7 December 1954. It was the chief secret service in communist Poland during the period of Stalinism. Throughout its existence, the UB was responsible for imprisoning, torturing and murdering at least tens of thousands of political opponents and suspects as well as taking part in secret actions such as Operation Vistula in 1947. The headquarters were located on Koszykowa Street in central Warsaw, but its branches and places of detention were scattered across the entire country, the most infamous being Mokotów Prison.
The Department of Security was replaced by marginally less repressive Security Service (SB) in 1956, though the structure and aim of both agencies remained almost identical. The SB functioned as the chief secret service until the fall of communism in Poland in 1989 and was disbanded in 1990. Between 1945 and 1990 all secret servicemen, functionaries, and employees were widely known by the public as Ubeki or in English "Ubeks" and singular "Ubek" (pronounced: OO-beck).