Excommunication is the ultimate ecclesiastical penalty, in which the offender is expelled from the Church. (The term itself signifies that the individual thus punished is no longer "in communion" with the Catholic Church.) Someone who has been excommunicated no longer has the right to the sacraments of the Church, and is not considered a Catholic unless or until the excommunication is lifted.
Excommunication can take two different forms. A ferendae sententiae excommunication comes after a formal canonical trial, and is often a matter of public record. A latae sententiae excommunication is incurred automatically, under the terms of the Code of Canon Law, as the punishment for certain offenses. In the case of a latae sententiae excommunication, there is no requirement for formal trial or announcement; in fact, the individual brings the punishment upon himself.
Excommunication latae sententiae is the canonical punishment for offenses such as heresy, violation of the seal of confession, or procuring an abortion. Catholics guilty of these offenses are excommunicated automatically, even in cases when Church authorities are unaware of their offense.
An excommunication can be lifted when the individual admits and makes appropriate efforts to atone for it. In many cases the excommunication can be lifted by a priest through sacramental Confession, although in some cases other conditions must be fulfilled.