Original: According to the Potsdam Agreement, the Soviet Military Administration in Germany (German initials: SMAD) was assigned responsibility for the (present-day) eastern portion of Germany.
Simplified: East Berlin was treated as part of the new East Germany, but technically was part of the Allied-controlled city of Berlin.