
521 S.W.2d 568 (1975)
Preston HUCKEBY, Appellant,
v.
Benton F. SPANGLER et al., Appellees.
Bill Wayne POMEROY, Appellant,
v.
Benton F. SPANGLER et al., Appellees.
Supreme Court of Tennessee.
March 24, 1975.
*569 James W. Gentry, Jr., Chattanooga, Charles D. Haston, McMinnville, for appellants.
John C. Curtis, Clarence E. Shattuck, Jr., H.E. Brown, Jerry H. Summers, S. Del Fuston, F.I. Breazeale, Chattanooga, for appellees.

OPINION
HARBISON, Justice.
Although these suits were instituted by separate complaints, they were disposed of in the trial court by a single order, and we have considered them together for purposes of this appeal. The complaints in the actions are similar, but because of one material difference in the two complaints, we will discuss them separately.
Appellant Huckeby instituted his action for damages against appellee Benton F. Spangler and twenty-two other named defendants on September 5, 1973. He attempted to sue all of the defendants individually and as members of an unnamed class of persons pursuant to Rule 23 of the Tennessee Rules of Civil Procedure. The trial court held, however, that the action could not proceed as a class action, and on this appeal appellant has conceded the correctness of the action of the trial court, so that the class action aspect of this case and of the companion case need not be considered further. Indeed appellants did not assign as error the action of the trial court in dismissing the suits insofar as the class action aspects of them were concerned.
In his complaint, appellant Huckeby alleges that he was an employee of the Tennessee Bureau of Investigation and in that capacity on September 11, 1972 was ordered by his superiors to report to the Chattanooga area to perform official duties. On September 12, 1972 he was directed by his superior officers to participate in a gambling raid on the Big Rock Motel and Club, which is alleged to be a place "wherein gaming and/or professional gambling was being carried on."
*570 The complaint alleges that the plaintiff and his fellow officers arrived at this establishment in the early morning hours of September 13, 1972. The complaint charges that the defendants "... who had a common purpose and objective, were engaged in an unlawful common enterprise which was the furtherance of gaming and/or professional gambling." The complaint further alleges that the defendants had conspired to violate the gambling laws of the state and charges that when the plaintiff arrived, all of the defendants were located in a single room of the establishment "for the sole purpose of gambling, an unlawful objective." The complaint then names three persons who are alleged to be "co-conspirators but not co-defendants" but there is no allegation as to whether these persons were the owners or operators of the establishment, or as to what their capacity was.
The complaint alleges that the plaintiff and the other officers had been ordered to the premises to execute a search warrant, to seek evidence of violation of certain of the state gambling laws, which are referred to in the complaint, T.C.A. § 39-2001 et seq.
It is alleged that plaintiff and his fellow officers rang the doorbell and identified themselves as agents of the Tennessee Bureau of Investigation when someone opened the door. It is then alleged that a scuffle broke out at the bottom of the stairwell, that plaintiff and other officers ran to a second door at the top of some stairs in order to gain entrance into the club. It is alleged that the other officers accompanying the plaintiff at this time were local police officers and highway patrolmen, all of whom identified themselves to persons inside the club and announced that they had a search warrant. It is alleged that two highway patrolmen were in full uniform at the top of the steps.
The complaint alleges that plaintiff and his fellow officers were visible from within the club and that the defendant Richie, who was employed by the three "co-conspirators" was sued in the action, fired a shot which struck the plaintiff in the right side of the face, causing him severe personal injury. The complaint alleges that Richie had been employed by the three persons who were not defendants in the action "to protect the defendants in their unlawful, common enterprise" and that he fired the shot in that capacity.
The complaint expressly charges that Richie and any other persons who fired upon the officers acted out of malice and without legal or just cause. It is finally alleged that Richie, who fired the shot and injured the plaintiff Huckeby, "was engaged in an unlawful, common enterprise with the rest of the defendants ... named above and that Richie was to protect the other co-defendants from interference in their unlawful acts and therefore all of those defendants engaged in said unlawful, common enterprises are jointly and severally liable to the plaintiff for compensatory as well as punitive or exemplary damages."
The only responsive pleading filed to this complaint by any of the twenty-three defendants was a motion to dismiss the suit insofar as the plaintiff sought to maintain it under Rule 23 as a class action. Each of the numerous motions appearing in the file are styled Motion Under Rule 23.03(1), and although filed by different counsel, the motions are substantially identical in their terms.
Apparently there was a hearing on these motions in the trial court, and there are contained in the technical record two drafts of orders, approved by some or all of the attorneys in the case, purporting to dismiss the action as a class action and allowing the defendants additional time within which to plead further. Neither of these orders, however, is signed by the trial judge. The only order signed by him which bears upon the issue states that the *571 court had considered all motions and briefs and had
"... made a ruling based upon all of the pleadings and the entire record in the case that the pleadings simply state that some unidentified person among a large group of patrons fired a shotgun injuring the plaintiffs. It is the opinion of the court that the pleadings do not state a cause of action against any one particular defendant and the court is of the opinion that the mere presence of patrons in an establishment where some alleged illegal operation is being conducted does not in itself make all patrons responsible for an unforeseen act of some individual."
The court accordingly concluded that the suits could not proceed as class actions, and he further ordered the suits dismissed in their entirety unless the plaintiffs should amend their complaints "and designate a conspiracy and overt act by particular defendants ..." Plaintiffs were allowed twenty days from the entry of this order within which to so amend; otherwise the suits were ordered to be dismissed.
Plaintiffs did not amend either complaint, but excepted to the ruling of the trial court and appealed here.
It is apparent from the foregoing that the trial court was mistaken insofar as the complaint of Huckeby is concerned. This complaint definitely charged that the defendant Richie shot the plaintiff, and said defendant is identified clearly and by name. Certainly a cause of action was stated as to him.
The complaint of Pomeroy is essentially similar to that of Huckeby, except that Pomeroy was a member of the Chattanooga Police Department, and in his complaint he did not identify the person who fired a shot which allegedly wounded him. He does charge that when plaintiff Huckeby fell from being wounded, Pomeroy was in his path and from the impact fell down a flight of stairs with resulting injury. In all other material particulars, that complaint follows the language and allegations of the Huckeby complaint.
The trial court erred in dismissing the complaint of Huckeby as to the defendant Richie, this error apparently being an inadvertent one on the part of the trial judge in treating the two complaints as identical, and in disposing of them in a single order.
In this Court each of the plaintiffs assigns as error the action of the trial court in dismissing his suit in its entirety, and upon the court's own motion.
On behalf of appellants it is insisted that the trial court had no authority, under the Tennessee Rules of Civil Procedure, to dismiss the complaints sua sponte and in the absence of a motion to dismiss filed pursuant to Rule 12. Although there is a split of authority on this subject, we are of the opinion that the trial court does have such authority, and that when he is of the opinion that the complaint fails to state a claim upon which relief may be granted, he may dismiss it, although such practice is not to be encouraged. In considering such action, the court should construe the complaint liberally in favor of the plaintiff, taking all of the allegations of fact therein as true. Any such dismissal by the trial court, like a dismissal under Rule 12, is subject to scrutiny on appeal. Williamson County v. Twin Lawn Development Company, Inc., 498 S.W.2d 317 (Tenn. 1973).
The principal question presented, therefore, is whether these complaints state a cause of action under applicable principles of Tennessee law.
There is no question but that the Tennessee statutes against gaming are quite broad in their terms, and they have been deemed by this Court in previous cases to declare a strong public policy of the state.[1]

*572 It is provided in T.C.A. § 39-2001 that:
"If any person play at any game of hazard or address for money or other valuable thing, or make any bet or wager for money or other valuable thing, he is guilty of a misdemeanor."
In the following code section it is made a misdemeanor for any person to "encourage or promote, aid or assist, the playing at any game, or the making of any bet or wager, for money or other valuable thing", or to keep or exhibit any sort of gambling device. Separate offenses are provided for the keeping of a gambling house or permitting the same to be kept, and there are detailed statutes prohibiting the keeping of facilities for encouraging or promoting certain prescribed types of gambling and the possession of any gambling table or device whatever. T.C.A. §§ 39-2003  2006. There are specific statutes requiring police officers and public officials to apprehend persons engaging in these offenses, and T.C.A. § 39-2010 provides as follows:
"Where any officer, or other person accompanying him, shall be unlawfully killed in arresting any person upon a charge of unlawful gaming, the slayer is guilty of murder in the first degree. If such officer or other person is stabbed or shot without being killed, the offender is guilty of a felony, and shall be punished as persons are punished for malicious stabbing."
Other statutes prohibit the transfer of negotiable paper founded on gambling or wagering considerations, forbid the placing of bets on horse races, outlaw lotteries, and prohibit various types of speculative trading. T.C.A. §§ 39-2012  2020.
Other statutes in this state make all contracts founded in whole or in part on a gambling or wagering consideration void to the extent of such consideration, forbid the enforcement of such contracts, and permit any person who has lost money on any game or wager to file suit to recover the same. T.C.A. § 23-1701 et seq.
There can be no question, therefore, but that the gambling statutes of the state are sweeping in their scope, and that persons engaging in this activity are engaged in an activity which is strongly proscribed. As early as 1857, this Court held that any person who participated in the activities prohibited by the state's gaming statutes was guilty of a criminal offense as fully as were the principals conducting the event. In that case a spectator at a cockfight which was being conducted by others and which had been advertised, was indicted for the offense of gaming. Quoting earlier versions of the statute, the Court said:
"How could anyone more effectually promote and encourage a game or match of this kind than by not only giving it countenance by his presence but actually paying his money to support and sustain it? The preparations are made by the principal offenders; notice is given of the time and place; the public are called upon to attend and pay money for the privilege of participating in the enjoyment of the sport; and the defendant accepts the invitation, and contributes his money to the extent of the fee demanded. Is he not actively and efficiently aiding, abetting and encouraging the unlawful thing"?
With respect to the defendant, the Court said:
"He did not do the unlawful thing himself, but contenanced, aided, and encouraged those who did by his presence and the contribution of his money."
In the case of McGrew v. City Produce Exchange, 85 Tenn. 572, 4 S.W. 38 (1887), the Court held that a party to a wagering contract who receives money lost thereon by another is liable to the loser, even *573 though the money had been received through an agent living in another city. The Court further held that all of the individual incorporators of a corporation engaged in such activities were personally liable for the sums lost by the plaintiff, the Court stating:
"When it appears that several have unlawfully combined and confederated to gamble with and defraud another through a selected party, each confederate participating is liable for the entire amount received, as the money is received for all, and by all, according to the devised illegal method under which they were all jointly operating."
There is no question but that when two or more persons engage in an unlawful act and one of them commits a serious civil injury upon a person not engaged therein, all are equally liable for damages to the injured party. One of the earliest cases so holding in this state is the case of Kirkwood v. Miller, 37 Tenn. 455 (1858). There, three persons, fearful of a general slave insurrection, captured and bound a slave who was not shown by the record to have been guilty of any offense. One of the three then killed the slave when he attempted to escape, and a civil action for damages was brought against all three of the defendants. Affirming a judgment against all of the persons involved, this Court stated:
"It may be, and doubtless was not intended by any of them, that the negro was to be killed, yet, if that resulted from the unlawful acts in which they were engaged, by the stroke of either, all would be equally liable for the damages. This is a risk that each joint trespasser incurs, by his participation in an unlawful enterprise. If the expression may be used, they are guarantors for each other. They are all answerable for any injury done by either, in the common enterprise. It is no defence against a claim, for the damage done in such a case, for anyone to say that the injury was greater, and the particular act done was not contemplated or intended by him. They embark in a common cause, and their liability is common."
Many other Tennessee cases have applied this principle in civil actions. In the case of Cogdell v. Yett, 41 Tenn. 229 (1860), the defendant engaged in an unlawful affray with another person. The other person injured a third party, and the defendant, who did not actually injure the plaintiff but who was participating in the affray, was held civilly liable to the third person.
See Day v. Walton, 199 Tenn. 10, 281 S.W.2d 685 (1955); Blalock v. Temple, 38 Tenn. App. 463, 276 S.W.2d 493 (1954); Roberts v. Hickson, 48 Tenn. App. 73, 343 S.W.2d 108 (1960). That all parties involved in a civil conspiracy or other unlawful activity are jointly liable see further Franklin v. Green, 47 Tenn. App. 696, 342 S.W.2d 233 (1961) and Brumley v. Chattanooga Speedway & Motordrome Company, 138 Tenn. 534, 198 S.W. 775 (1917).
Although somewhat conclusory in their nature, we are of the opinion that the allegations of the complaints are sufficient to charge all of the defendants named in the actions with being present at a gambling establishment and participating knowingly and willfully in violation of the state's gambling laws in the early morning hours of the date on which the injuries occurred. The complaints allege that police officers, lawfully on the premises and discharging their proper duties, were fired upon by a person or persons engaged to protect the gambling activities, and as a result personal injuries were sustained by each of the plaintiffs.
Apparently the trial judge assumed in this case that all of the named defendants were merely "patrons" and that the acts of Richie and other persons who may have fired guns were "unforeseen".
These facts remain to be developed, however, because the complaint does not describe the defendants as patrons, or otherwise. The conclusion that the shootings *574 were "unforeseen" is nothing more than an assumption by the court, not based upon any allegations of the pleadings. In the first place, the use of force to repel police officers in making an arrest on a gambling charge was sufficiently foreseeable and probable that the General Assembly passed a specific statute, prescribing severe criminal penalties for such conduct. T.C.A. § 39-2010. Secondly, it is not developed from the allegations of the complaint whether the defendants, or any of them, were regular patrons, had knowledge of the presence of Richie or other persons employed to "protect" the operations, or whether any of the defendants had an opportunity to intervene and prevent the firing upon the officers, who are alleged to have identified themselves properly. Therefore, the conclusion of the trial judge that the firing of shots at the plaintiffs was "unforeseen" is an unwarranted assumption and conclusion from the allegations of the pleadings before him.
Further, foreseeability is not necessarily a test of liability where persons are engaged in an unlawful activity, and one of the participants inflicts injury upon an innocent third party. Foreseeability may become a factor where the parties are engaged in a lawful enterprise and one of them commits an act not contemplated by the others. Day v. Walton, 199 Tenn. 10, 281 S.W.2d 685 (1955). It is not necessarily a factor when the activities are unlawful in their nature.
In addition to being enunciated in a number of the Tennessee cases referred to in earlier portions of this opinion, this rule is well stated in the case of Thompson v. Johnson, 180 F.2d 431 (5th Cir.1950):
"... where two or more persons engage in a common enterprise, they are jointly liable for wrongful acts done in connection with that enterprise, at least where the enterprise is an unlawful one, in which case all are answerable for any injury done by any one of them, although the damage done was greater than was foreseen or the particular act was not contemplated or intended by them." 180 F.2d at 434
Although we have not been cited to any cases applying this rule to unlawful gambling activities, it has been widely applied in other types of unlawful undertakings.
Thus in the case of American Family Mutual Insurance Company v. Grim, 201 Kan. 340, 440 P.2d 621 (1968), four boys, including the 13-year-old defendant, broke into a church building at night with the intention of obtaining some soft drinks from the church kitchen. Two of the boys lit paper torches to illuminate the premises and failed properly to extinguish them. A resulting fire caused some $25,000.00 in damages to the building. The youthful defendant in the reported case had nothing to do with the use of the torches and was not even present in the area of the church where the fire started. Nevertheless he was held liable in tort for the entire building damage since he was engaged in a common unlawful venture with the other boys.
In the case of Keel v. Hainline, 331 P.2d 397 (Okl. 1958), students in a classroom were throwing blackboard erasers and other objects at each other with the intention of striking each other. This was done in sport and without intent to cause injury. One of the erasers, however, struck an innocent bystander in the eye shattering her glasses and resulting in the loss of her vision. A defendant, who had aided and encouraged the wrongful activity by retrieving the erasers and handing them to others for further throwing, was held liable for the resulting injury, even though he did not himself participate in throwing the erasers.
Numerous cases applying this principle in widely varying factual situations are cited at 74 Am.Jur.2d, Torts, § 68. See also Restatement, Torts, § 876; Prosser, Law of Torts, 291-293 (4th ed. 1971).
We, therefore, conclude that there are sufficient allegations of fact made in the complaints that dismissal of the actions by the trial judge sua sponte was erroneous. *575 The complaints might well have been susceptible to a motion for a more definite statement pursuant to Rule 12.05 of the Tennessee Rules of Civil Procedure, but the defendants elected not to file such a motion and did not include it with their motion to dismiss the suits as class actions.
We wish to make it clear that the facts of these cases remain to be developed. We express no opinion whatever upon the ultimate merits or outcome of the litigation. There may be factual distinctions which can be developed among the various defendants, and, of course, there may be many and varied defenses available to the claims. We simply hold that the allegations of the complaints as filed were sufficient to overcome a motion to dismiss for failure to state a claim, had such a motion been filed. Therefore the trial judge erroneously dismissed the actions on his own motion.
The judgments below are reversed and these cases are remanded for further proceedings consistent herewith. Costs of the appeals are taxed to the appellees.
FONES, C.J., and COOPER, BROCK, and HENRY, JJ., concur.
NOTES
[1]  See opinion of Catron, J., in State v. Smith, 10 Tenn. 271 (1829). It cannot be assumed that these laws are simply relies of an earlier era. Not only have early statutes been retained, but recent amendments have proscribed professional gambling of all types and have provided both civil and criminal remedies for its suppression. See T.C.A. § 39-2031 et seq.
