
575 So.2d 1100 (1991)
Larry D. MEEK
v.
DIVERSIFIED PRODUCTS CORPORATION.
Ex parte Larry D. MEEK.
(Re Larry D. MEEK v. DIVERSIFIED PRODUCTS CORPORATION).
89-1610, 1900113.
Supreme Court of Alabama.
March 1, 1991.
Ruth S. Sullivan, Dadeville, for appellant and petitioner.
Larry E. Forrester of Smith, Currie & Hancock, Atlanta, Ga., and W.F. Horsley of Samford, Denson, Horsley, Pettey, Martin and Barrett, Opelika, for appellee and respondent.
SHORES, Justice.
Larry D. Meek, plaintiff in a lawsuit, filed a petition for a writ of mandamus, challenging an award of attorney fees to the defendant, Diversified Products Corporation, *1101 under the Alabama Litigation Accountability Act, §§ 12-19-270 through -276, Ala.Code 1975 (1987 Cum.Supp.). We deny the petition for writ of mandamus.
Meek filed the complaint in this case, his second lawsuit against Diversified, on March 24, 1989. In this second suit he claimed that he had been discharged in retaliation for instituting or maintaining an action for worker's compensation benefits, and that he had been discharged in derogation of Diversified's employee handbook. His complaint was timely answered by Diversified.
On February 1, 1990, Diversified filed motions to dismiss and for summary judgment on the grounds that Meeks was trying to relitigate his workers' compensation case. Diversified argued that the loss or injury alleged in the instant case derived from the same set of circumstances as those previously litigated, i.e., Meek's onthe-job injury. The trial court held a hearing at which Meek's deposition was considered and during which Meeks admitted that the only damages he sought in the present action were to compensate for the medical expenses related to a Dr. Serrato's treatment of his on-the-job injury. The trial court granted the motion for summary judgment. Meek did not appeal from the summary judgment.
During the hearing on the motion for summary judgment, counsel for Diversified requested, and was granted, permission from the court to file a motion pursuant to the Alabama Litigation Accountability Act. Diversified filed its motion for an award of attorney fees and a supporting memorandum of law on March 30, 1990. After a hearing on the matter, the trial judge awarded attorney fees to Diversified and entered a judgment against Meek's attorney in the amount of $11,550.00.
Meek and his attorney filed motions on July 11 and 18, 1990, seeking post-judgment relief from the trial judge's order. Before the trial court could rule on these motions, a notice of appeal was filed on July 23, 1990 (Case No. 89-1610). Our denial of the writ of mandamus makes Case No. 89-1610 moot.
The trial judge's order read as follows:
"This case is before the Court on Defendant's MOTION FOR AWARD OF ATTORNEYS' FEES and Plaintiff's response. Upon consideration of the briefs and arguments of the parties, the Court concludes that Defendant's Motion is due to be and is hereby GRANTED.
"This matter arose out of an on-the-job injury sustained by Plaintiff while in Defendant's employment. Plaintiff's injury occurred on January 26, 1986. He was terminated by Defendant on March 25, 1987. Plaintiff filed a Workmen's Compensation suit against Defendant on July 11, 1987. That case (Civil Action 87-209) was tried on June 23, 1988, and judgment was rendered in favor of Plaintiff on July 22, 1988. Plaintiff was awarded benefits for permanent, total disability.[1]
"Plaintiff filed the present lawsuit on March 24, 1989. The complaint sets forth the following grounds for relief:
"1. Wrongful Discharge
"2. Retaliatory Discharge
"3. Damages for lost medical insurance coverage.
"These claims arise out of the same facts and circumstances which formed the basis of and preceded Plaintiff's previous lawsuit.
"Defendant, in this case, filed a Motion to Dismiss and a Motion for Summary Judgment on February 1, 1990. The Court held oral arguments on Defendant's motions on February 22, 1990. The Court found that there was no genuine issue of material fact in dispute and entered an order granting summary judgment. Plaintiff did not appeal this order.
"Presently before the Court is Defendant's Motion for an Award of Attorneys' Fees filed pursuant to the Alabama *1102 Litigation Accountability Act, § 12-19-270 et seq., Code of Alabama (1975, as amended).
"The Act defines `without substantial justification' as follows:
"`The phrase "without substantial justification," when used with reference to any action, claim, defense or appeal, including without limitation any motion, means that such action, claim, defense or appeal (including any motion) is frivolous, groundless in fact or in law, or vexatious, or interposed for any improper purpose, including without limitation, to cause unnecessary delay or needless increase in the cost of litigation, as determined by the court.' § 12-19-271, Code of Alabama (1975, as amended).
"Thus, the question now before the Court is whether the present case was instituted without substantial justification.
"The same parties and attorneys were previously before the Court in Civil Action 87-209 on a claim for workmen's compensation benefits. In that case Defendant was ordered to pay to Plaintiff permanent total disability benefits as well as all necessary and reasonable medical expenses. An award of attorneys' fees was also granted to Plaintiff.
"The claims presented in Plaintiff's present complaint arose prior to or out of the same circumstances made the basis of Plaintiff's prior lawsuit. All such causes of action should have been asserted in the previous lawsuit. Not only does Rule 15 of the Alabama Rules of Civil Procedure allow a party to amend its pleadings freely where justice so requires, but Rule 42 provides for consolidation of actions involving common questions of law or fact in order to avoid unnecessary cost or delay.
"At the hearing on Defendant's Motion, a letter from Plaintiff's Attorney to Defendant was admitted into evidence. In this letter, she states that `This lawsuit can be settled by payment of Dr. Serrato's bill and other charges....' The Court specifically notes that, in CV-87-209, it found that Defendant did not authorize Plaintiff to seek medical treatment from Dr. J.C. Serrato and those medical bills resulting from such treatment were not covered by the Workmen's Compensation Act.
"It appears to the Court that this suit is, in part, an effort to require payment of medical bills for which the Court held in the prior suit Defendant was not liable.
"Plaintiff had already been discharged by Defendant at the time the prior suit was filed. No reason was given by Plaintiff as to why a claim for wrongful discharge was not included in the prior suit.
"FINDINGS OF FACT
"Upon consideration of all evidence presented in this matter, the Court makes the following findings of fact:
"1. Plaintiff made no effort to determine the validity of the present cause of action before it was asserted.
"2. Plaintiff made no effort after the commencement of this action to dismiss those claims found not to be valid.
"3. As attorney of record for Plaintiff in CV-87-209, Plaintiff's attorney was privy to all facts arising out of the previous cause of action which would assist her in determining the validity of the present cause of action.
"4. No cause of action or claim asserted by Plaintiff reflects a good faith attempt to establish a new theory of law in this state.
"5. This action was prosecuted in bad faith and for an improper purpose.
"Based on the foregoing the Court finds that the present case was brought without substantial justification.
"There is no question that this lawsuit should not have been filed. The Defendant has incurred legal fees of $11,550.00 in defending it. At the hearing held on this Motion, the attorney for Plaintiff made no issue of the reasonableness of the amount of these fees.
"The question before the Court now is, who should paythe Plaintiff or his attorney? *1103 The same attorney has represented Plaintiff in both lawsuits. That attorney is an experienced member of the bar and should bear the responsibility for initiating this second lawsuit.
"FINAL JUDGMENT
"It is hereby ORDERED, ADJUDGED, AND DECREED by the Court that Diversified Products Corporation, Defendant, have and receive of Ruth S. Sullivan, Attorney for Defendant, a judgment in the sum of $11,550.00, for which let execution issue.
. . . . .
"Done and Ordered the 13th day of June, 1990.
         "/s/ Robert M. Harper
         "Circuit Judge"
The trial judge's order gives the factual background of the case and reflects an appropriate utilization of the Alabama Litigation Accountability Act. We note that the trial judge set forth substantial reasons for this award, as required by § 12-19-273. This section permits the trial court to exercise its discretion in the awarding of attorney fees authorized by the statute, but requires that it set forth the reasons for the award. Tidwell v. Waldrop, 554 So.2d 1009, 1010 (Ala.1989), and A & M Grocery v. Lopez, 567 So.2d 261, 263-64 (Ala.1990).
In his petition for writ of mandamus, Meek challenges the trial court's authority to consider Diversified's motion for attorney fees 36 days after the court had entered a summary judgment for Diversified. Meek contends that the language of § 12-19-272 requires that the award of attorney fees be a part of the summary judgment.
The record reflects that the issue of attorney fees was raised by Diversified during the hearing on its motion for summary judgment. The trial court specifically granted Diversified's request to file a written motion and brief. This reserved the court's jurisdiction of Diversified's motion and gave ample notice to the plaintiff and his attorney.
The specific language of the Alabama Litigation Accountability Act, consistent with its intent, provides for the trial court to consider the outcome of the proceedings in determining whether a party's action was without substantial justification. § 12-19-273(7). The holding of a separate hearing on the motion for an award of attorney fees after the entry of the summary judgment was a proper exercise of discretion by the trial court. The hearing provided an opportunity for the plaintiff and his attorney to be heard.
For the reasons stated above, the petition for writ of mandamus is due to be denied.
CASE 1900113, WRIT DENIED.
CASE 89-1610, DISMISSED AS MOOT.
MADDOX, HOUSTON, KENNEDY and INGRAM, JJ., concur.
NOTES
[1]  Meek had been receiving temporary total and permanent partial disability benefits since the time of his injury. The circuit court awarded Meek $414,225.24 in permanent total disability benefits discounted to present value.
