The plaintiff s main contention on appeal is that their substitute petition for a writ of mandamus under G. L. c. 249, § 5, as in effect prior to St. 1973, c. 1114, § 291, was improperly dismissed for failure to state a cause of action. See now Mass.R.Civ.P. 1A, 81(b), 365 Mass. 731, 841 (1974). See also Beaton v. Land Court, 367 Mass. 385, 386 n.3 (1975).
For the purpose of ruling on the legal sufficiency of the substitute petition, we must take the allegations therein to be true. Nader v. Citron, 372 Mass. 96, 97-98 (1977). We are unable to say that it appears beyond doubt that there is no set of facts which the plaintiffs could prove in support of their claim which would entitle them to relief. Id. at 98. The plaintiffs have pleaded enough to establish that in the circumstances present here an action in the nature of mandamus would lie to recover land illegally diverted from public use. See Gould v. Greylock Reservation Comm., 350 Mass. 410, 427 (1966). Cf. Robbins v. Department of Pub. Works, 355 Mass. 328, 330 (1969). See also Attorney Gen. v. Suffolk County Apportionment Commrs., 224 Mass. 598, 609-610 (1916). Rut *872see Reading v. Attorney Gen., 362 Mass. 266, 268-271 (1972). If as alleged, the city council conveyed the land in question to the conservation commission (see G. L. c. 40, § 3) to maintain and preserve it for the use of the public for conservation purposes (compare Muir v. Leominster, 2 Mass. App. Ct. 587, 591-592 [1974]), the later transfer by the city to a private party without compliance with the relevant statutory and constitutional provisions was unauthorized and illegal. See G. L. c. 40, §§ 3, 15, 15A and art. 49, as amended by art. 97, of the Amendments to the Massachusetts Constitution. See also Bouchard v. Haverhill, 342 Mass. 1, 3-4 (1961). But see Muir v. Leominster, supra at 592-593.
Acheson H. Callaghan, Jr. (Scott F. Burson with him) for the plaintiffs. Ira H. Zaleznik for the defendants.It was thus error for the judge to allow the defendant’s motion to dismiss. Nader v. Citron, supra at 98.
Judgment reversed.