It is very difficult to settle on when the legal profession appeared, because of all the confusion as explained above about who is a lawyer. If one strongly describes a lawyer as a person who makes their living through advocacy in a court of law on behalf of others, then the first lawyers were probably the orators of ancient Athens. Nevertheless, Athenian orators faced serious structural barriers. First, there was a rule that individuals were supposed to implore their own cases, which was soon avoided by the increasing tendency of individuals to ask a "friend" for assistance. Luckily, around the middle of the fourth century B.C., the Athenians arranged of the automatic demand for a friend.
Second, a more serious problem, which the Athenian orators never completely beat, was the rule that no one could take a fee to beg the cause of another. This law was extensively ignored in practice, but was never eliminated, which meant that orators could never present themselves as legal professionals or experts. They had to support the legal fiction that they were merely an ordinary citizen generously helping out a friend for free, and thus they could never organize into a real profession — with professional associations and titles and all the other spectacle and circumstance — like their modern counterparts. Consequently, if one thins the definition to those men who could practice the legal profession openly and legally, then the first lawyers would have to be the orators of ancient Rome.
A law enacted in 204 B.C. disqualified Roman advocates from taking charges, but the law was widely ignored. The prohibit on fees was abolished by Emperor Claudius, who legalized advocacy as a profession and allowed the Roman advocates to become the first lawyers who could put into practice openly — but he also imposed a fee ceiling of 10,000 sesterces. This was evidently not much money; the Satires of Juvenal protest that there was no money in working as an advocate.
Like their Greek contemporaries, early Roman advocates were trained in rhetoric, not law, and the judges before whom they disputed were also not law-trained. But very early on, unlike Athens, Rome developed a class of specialists who were learned in the law, known as jurisconsults (iuris consulti). Jurisconsults were prosperous amateurs who experimented in law as an intellectual hobby; they did not make their primary living from it. They gave lawful opinions (responsa) on legal issues to all comers (a practice known as publice respondere).