At the age of 20 he began to read law under the tutelage of James Shields and Governor William H. Bissell,[2] and was admitted to the Illinois bar in 1846.Ill health prompted O'Melveny to move to Benicia, and practiced before a Major Cooper, "judge of the first instance under the Mexican regime (corresponding nearly to our justice of the peace.)"[1][3] After his temporary return to Illinois and his marriage, he established a "lucrative law practice" and had "achieved sufficient prominence" to become a Circuit Court judge of five southern counties in 1857.In winter 1862–63, he was put forward as a candidate to fill the Senate vacancy caused by Douglas's death, "but was defeated in the Democratic caucus for the nomination by two votes.He was "connected" with ex-Mayor Henry T. Hazard—one source says as a law partner—and he was said to have taken "a vital part" in bringing the Southern Pacific Railroad to Los Angeles in 1876.