LOS ANGELES — Cardinal Roger M. Mahony, who retired less than two years ago as the leader of the nation’s largest Roman Catholic archdiocese, was removed from all public duties by his successor, Archbishop José H. Gomez, as the church complied with a court order to release thousands of pages of internal documents that show how the cardinal shielded priests who sexually abused children.

The documents, released as part of a record $660 million settlement in 2007 with the victims of abuse, are the strongest evidence so far that top officials for years purposely tried to conceal abuse from law enforcement officials. The files, which go from the 1940s to the present, are the latest in a series of revelations that suggest that the church continued to maneuver against law enforcement even after the extent of the abuse crisis emerged.

Auxiliary Bishop Thomas Curry, who was the vicar for clergy and one of the cardinal’s top deputies and his adviser on sexual abuse, also stepped down as the regional bishop for Santa Barbara, Calif.

The church had fought for years to keep the documents secret, and until this week it argued that the names of top church officials should be kept private. In letters written in the 1980s, then-Father Curry gave suggestions for how to stop the police from investigating priests who admitted that they had abused children, like stopping the priests from seeing therapists who would be required to alert law enforcement about the abuse.