
462 So.2d 1157 (1984)
Richard E. THOMAS, Appellant,
v.
Edwin C. RATINER, Franklin B. Glinn and Ratiner and Glinn, P.A. and Tito Nieves, Appellees.
No. 83-2362.
District Court of Appeal of Florida, Third District.
November 20, 1984.
Rehearing Denied February 5, 1985.
*1158 Kelner & Kelner and Milton Kelner, for appellant.
Horton, Perse & Ginsberg and Edward A. Perse, Smathers & Thompson, Miami, for appellees.
Before SCHWARTZ, C.J., and BARKDULL and JORGENSON, JJ.
BARKDULL, Judge.
Richard E. Thomas is a medical doctor employed at Glades General Hospital in Belle Glades, Florida, as Director of Emergency Services. He is also a member of the Florida Bar in good standing. On January 22, 1982, Richard E. Thomas, allegedly in his capacity as an attorney, entered into a retainer fee contract with the defendant, Tito Nieves, while Nieves was a patient in Glades General Hospital. Thereafter, Tito Nieves entered into a written retainer agreement with the law firm of Ratiner and Glinn who had orally been employed prior to signing with Thomas. Tito Nieves then discharged Richard E. Thomas. As a result thereof, Thomas brought the instant action seeking damages against Ratiner and Glinn for tortious and intentional interference with his retainer contract with Nieves. He also sued Nieves for services rendered. After a jury trial, the trial court entered the final judgments presently under review wherein *1159 Thomas was awarded zero damages against Ratiner and Glinn and costs were awarded to Ratiner and Glinn. Thomas recovered $5,489 from Nieves for services rendered plus costs. Ratiner and Glinn have cross-appealed the judgment in favor of Thomas and against them.[1] Nieves has cross-appealed from the judgment in favor of Thomas and against him.
While several points have been raised on the main and cross-appeals, we need to discuss only one in determining this appeal. By their cross-appeal all of the defendants allege the trial court erred in denying their motions for directed verdict on the ground that Thomas had solicited his contract with Nieves in violation of Section 877.02 Florida Statutes (1981) and that said act rendered Thomas's contract void ab initio and incapable of being sued upon. We agree with this contention for the following reasons. Thomas contends that when he signed the contract with Nieves he was contacting him as a lawyer, not as a doctor, thus Section 877.02, Florida Statutes (1981) is not applicable to him and he was not guilty of violation thereof. This contention is simply without merit. Section 877.02(2) provides:
"It shall be unlawful for any person in the employ of or in any capacity attached to any hospital ... to communicate directly or indirectly with any attorney or person acting on said attorney's behalf for the purpose of aiding, assisting or abetting such attorney in the solicitation of legal business or the procurement through solicitation of a retainer, written or oral, or any agreement authorizing the attorney to perform or render legal services." (emphasis added)
Thomas was Director of Emergency Services at Glades General Hospital in complete charge of anything to do with emergency services. As such, he was an employee attached to the hospital when he obtained the retainer agreement from Nieves. Thomas was present in the hospital, in the hospital administrator's office, when he was informed by the hospital administrator that Nieves wanted to see him. To permit him to now say that "I went to Nieves' room as an attorney, not a doctor, so it is all right" would simply belie the facts. His knowledge of Nieves' problem and his invitation to Nieves' room were all gained by virtue of the fact that he was present in the hospital in his capacity as an employee. This cannot be changed by his mere statement that he is now a lawyer. Therefore, we find that Thomas acquired the retainer agreement from Nieves in violation of Section 877.02(2), Florida Statutes (1983). Said violation has rendered the retainer agreement void ab initio. The right to contract is subject to the general rule that the agreement must be legal and if either its formation or its performance is criminal, tortious or otherwise opposed to public policy, the contract or bargain is illegal. See 11 Fla.Jur.2d, Contracts § 81, Restatement of the Law, Contracts § 512. Certainly Section 877.02, Fla. Stat. (1983) renders formation of Thomas' retainer agreement unlawful and solicitation of clients by an attorney is against public policy. Where a statute imposes a penalty for an act, a contract founded upon said act is considered void in Florida. See and compare 11 Fla.Jur.2d, Contracts § 85; Anno. 55 A.L.R.2d 481. Inasmuch as Thomas' retainer agreement is void ab initio, said contract cannot be the basis of a cause of action against any of the defendants herein and the trial court should have directed a verdict in their favor.
Therefore, the final judgments and cost orders appealed herein are reversed and the cause is remanded to the trial court with directions to enter directed verdicts for the defendants herein and to award them appropriate costs as prevailing parties.
Reversed and remanded with directions.


*1160 OPINION ON REHEARING
The appellant has urged in his petition for rehearing that because there can be interference with an unenforceable agreement, citing United Yacht Brokers, Inc. v. Gillespie, 377 So.2d 668 (Fla. 1979); Smith v. Ocean State Bank, 335 So.2d 641 (Fla. 1st DCA 1976); Franklin v. Brown, 159 So.2d 893 (Fla. 1st DCA 1964); Tamiami Trail Tours v. Cotton, 432 So.2d 148 (Fla. 1st DCA 1983); Fearick v. Smugglers Cove, Inc., 379 So.2d 400 (Fla. 2nd DCA 1980); Allen v. Leybourne, 190 So.2d 825 (Fla. 3rd DCA 1966), the opinion entered in this cause is erroneous. We do not agree. In each of the cited cases, the contract alleged to be interfered with was unenforceable for some deficiency which did not render it void. An action may lie for interference with an unenforceable contract and even perhaps a voidable contract. No such cause of action lies for interference with a contract void as against public policy and which makes one who is a party thereto, as the appellant in the instant case, guilty of a criminal act for entering into such an agreement. See Section 877.02 of the Florida Statutes (1981). Therefore the petition for rehearing is denied.
NOTES
[1]  Ratiner and Glinn have cross-appealed as to that judgment entered against them and in favor of Thomas in the amount of zero damages.
