Was Erle Stanley Gardner, the creator of Perry Mason ever a lawyer?

Yes, Erle Stanley Gardner was a lawyer.

Born in 1889, he was admitted to the California bar in 1911 and was known for defending poor Chinese and Mexicans.

In the 1940s, he founded the Court of Last Resort, an organization dedicated to helping people unjustly imprisoned.