Jenkins, Justice.
The sheriff of Dougherty County filed a petition for injunction against the deputy sheriff serving under him. It was alleged that on account of personal differences he had informed the defendant that “he had been dismissed and discharged as his deputy,” and had “requested that he surrender to him his keys, official papers, and that he no longer attempt to perform any duties as deputy sheriff;” but that in response the defendant refused to deliver the keys or official papers or to discontinue as deputy sheriff, and insisted that “he would continue as deputy sheriff until prevented from doing so by the court;” and that such conduct and his occupation of any of the offices or premises under the supervision of the sheriff, or an attempt on his part to perform any duties as deputy sheriff, constituted a continuous trespass, the avoidance of which and the prevention of a multiplicity of suits gave equitable jurisdiction to the court. The prayers were that the defendant be enjoined from interfering with the plaintiff in the performance of his duties as sheriff, by coming into his offices in the court-house, or going on the jail-house premises, or interfering with the jail-house or inmates, or “attempting to perform any *181service or giving any orders in reference to same;” from taking possession of any books, official papers, other documents, or furniture of the office of sheriff; and “from retaining the keys and. official papers in his possession; and that he be required to deliver same to plaintiff.” The defendant demurred generally on the grounds that no sufficient facts for the grant of an injunction were alleged; that there was a full, adequate, and complete remedy at law; and that a mandatory injunction could not be granted; and specially to particular paragraphs, on the ground that there were no sufficient averments of fact as to the alleged “personal differences” and the “ official papers.” The evidence at the interlocutory hearing consisted of the sworn pleadings, an affidavit by the petitioner, and a counter-affidavit by the defendant. The petitioner’s affidavit stated that the defendant, in response to the request for a surrender of official papers and the keys to the office and jail and for a discontinuance of his acts as deputy sheriff, replied that he declined and refused to recognize the authority of the petitioner to discharge him, would retain possession of the property held as deputy, “and would continue to act as such until [petitioner] obtained a court order to stop him.” The defendant’s counter-affidavit stated that there were no personal differences; that he previously “had several warrants belonging to a justice of the peace,” but at the time of the hearing had no official papers; and that he had not refused to surrender the keys, but only told the sheriff that he desired to consult his lawyer before turning over to him the keys. It was also shown at the hearing that the defendant “had several criminal warrants and the keys to the jail, all of which he delivered to the coroner when he was served.” The record does not show that the defendant at the hearing admitted the legality of his discharge; but by brief of counsel in this court he concedes, that, “having been discharged as deputy sheriff, and the sheriff having a right to so discharge him, there was no reason to try the title to the office;” and he contends that all equitable jurisdiction was therefore ousted. The court overruled all demurrers, and granted an interlocutory injunction as prayed.
1. “An injunction may only restrain; it may not compel a party to perform an act.” Code, § 55-110. “While under the code an injunction which is purely mandatory in its nature can not be granted, the court may grant an order the essential nature *182of which is to restrain, although in yielding obedience to the restraint the defendant may incidentally be compelled to perform some act.” Rosser v. Styron, 171 Ga. 238, 240 (3) (155 S. E. 23), and cit.; Noland v. Biggers, 171 Ga. 627, 631 (156 S. E. 266). In the instant injunction proceeding by a sheriff praying that his former deputy be enjoined from performing the duties of the office from which he had been discharged, it was not illegal to incidentally require that he turn over to the sheriff the jail and office keys and official papers in his possession. The gravamen of the proceeding was not to compel the delivery of property, as was true in Rudolph Wurlitzer Co. v. Jackson, 134 Ga. 333, 334 (67 S. E. 879), but was to prevent the discharged deputy from further performing the duties of the office from which he had been discharged, and the possession of the property which he held as deputy, although a proper incident to the main suit, was only incidentally involved. Equity, having properly taken jurisdiction of the matter which was the gist of the proceeding, had the right to give complete relief as to the incidental matters of possession of official keys and papers (Code, § 37-105), irrespective of whether or not as to such incidental matters alone the petitioner would have had an adequate remedy at law by trover as to the keys and by proceedings under the Code, § 89-602 et seq., as to the official papers. See, in this connection, Clarke County v. Gamble, 136 Ga. 382 (71 S. E. 797); Albea v. Watts, 114 Ga. 149 (39 S. E. 940). Under the preceding rulings, the court did not err in overruling the demurrers to the petition.
2. At the interlocutory hearing it indisputably appeared that the defendant had already turned over to the coroner the keys and papers in question, upon his being served by that officer with a copy of the petition and temporary restraining order. Since the defendant had thus effectually and completely responded to the petitioner’s demand with respect to such articles, the order granting the injunction as prayed should, strictly speaking, have expressly eliminated the requirement with reference to their delivery (see Baggett v. Edwards, 126 Ga. 463 (5), 55 S. E. 250); but since the record shows such previous delivery, the general order will be reasonably construed as not having them in view.
3. The judge did not abuse his discretion in granting the injunction restraining the deputy sheriff from further seeking to *183perform the functions of the office from which he had been discharged. While the record shows that at the time of the interlocutory hearing the defendant had turned over the keys and papers pertaining to the office from which he had been discharged, such conduct on his part was not inconsistent with his alleged claim that he continued in office, but might have been ouly an act done in obedience to his superior in authority. Even if it had been made to appear at the hearing, as is now conceded in the brief of counsel for the defendant, that the discharge was legal and that the defendant had been deprived of his office, under the sworn allegations of the petition and the supporting proof there was no abuse of discretion in restraining the defendant from further official activities, since it does not necessarily follow that even an expressed abandonment by a defendant of his illegal course of action would be sufficient reason for denying an injunction. 32 C. J. 77, § 63. Judgment affirmed.
All the Justices concur.