Judgment unanimously affirmed without costs. Memorandum: Supreme Court properly entertained petitioners’ CPLR article 78 proceeding and directed respondents to comply with section 252 of the Charter of the City of Buffalo, which requires the appointment of four deputy commissioners of fire. Respondents acknowledge that there are presently only two deputy commissioners of fire, but argue that this has been their practice since 1978 and that petitioners should not now be heard to complain. The court properly rejected respondents’ claims of prematurity, untimeliness and laches. This is a mandamus proceeding to compel compliance with an ordinance; such proceeding must be commenced within four months from refusal of a demand to perform the act required by law (see, Matter of De Milio v Borghard, 55 NY2d 216, 220). Here, there was no formal demand until petitioners commenced the proceeding. Accordingly, the petition may be construed as the demand and the answer as a refusal, rendering the proceeding timely commenced (see, Matter of Waterside Assocs. v New York State Dept, of Envtl. Conservation, 127 AD2d 663, 665-666, affd 72 NY2d 1009). Petitioners were not required to make a demand for statutory compliance earlier because it is clear from respondents’ established policy that a demand, if made, would have been refused (see, Matter of Baum v Town Bd., 98 AD2d 918, 919). The defense of laches is not available to respondents because the relief petitioners *1144seek is not discretionary but, rather, is mandated by law (see, 75 NY Jur 2d, Limitations and Laches, § 335, at 539-540). (Appeal from judgment of Supreme Court, Erie County, Forma, J.—art 78.) Present—Doerr, J. P., Boomer, Green, Lawton and Lowery, JJ.