delivered the opinion of the court.
The plaintiff in error was convicted and fined $200 under an indictment charging him with having unlawfully and corruptly received money under an agreement to vote for one W. G. Long, a candidate for Commonwealth’s attorney, in an election held in Dickenson county November 7, 1911.
*1029The accused asked leave to file his plea setting up the defense that in a proceeding contesting the election in question he had been required to testify concerning his participation in such election, and that he was, therefore, under the express terms of the statute, entitled to immunity from prosecution for the offense charged. In support of this plea the accused offered to file therewith all of the proceedings in the contested election case, including his own deposition therein. The circuit court refused to allow this plea to be filed, taking the view that the accused was not entitled to the immunity claimed because the contested election proceeding was under the general election laws and not under section 145a of the Code.
It is true that the petition in the contested election case alleges other irregularities and the violation of other statutes, but it expressly charges offenses in the very terms of section 145a of the Barksdale Pure Election Law, and the testimony of the plaintiff in error in that proceeding recounts a number of transactions between himself and others in violation of section 145a, which provides that “no person shall expend, pay, promise, loan or become pecuniarily liable in any way for any money or other valuable thing in behalf of any candidate for office at any election, primary or nominating convention held in this Commonwealth.”
Clause 9 of section 145a, as amended by Acts 1908, p. 561, provides as follows: “No witness giving evidence in any prosecution or other proceeding under this act shall ever be proceeded against for any offense against this act or against the other election laws committed by him at or in connection with the same election.”
In Flanary’s Case, 113 Va. 775, 75 S. E. 289, which controls the present case, the defendant had testified in an inquiry before the grand jury and his testimony was *1030not confined to violations of section 145a, but concerned violations of other election laws, and this court held that, as he had testified in a proceeding before the grand jury which inquired into the violations of section 145a, as well as into violations of other provisions of the election laws, he was immune from prosecution under any election law.
In the case at bar, the inquiry referred to in the plea was as to the violation of the election laws, including violations of the provisions of section 145a, and the evidence given by the accused in that proceeding was directed specifically to violations of section 145a. Under the decision of this.' court in Flanary’s Case, supra, the defendant was clearly entitled to complete immunity from prosecution for the offense charged if the facts alleged in his plea were true. He should, therefore, have been permitted to file his plea and to sustain the same by such proper evidence as he might have had to offer.
The judgment complained of must, therefore, be reversed, the verdict of the jury set aside and the case remanded for a new trial not in conflict with the views, herein expressed. . . .
Reversed.