PUTNAM, J.
It is well settled that a nonresident of the state, while here in attendance upon a court as a party or a witness, cannot be arrested, or served with a process in a civil action. Parker v. Marco, 136 N. Y. 585, 32 N. E. 989; Matthews v. Tufts, 87 N. Y. 568; Person v. Grier, 66 N. Y. 124. There are cases, however, holding that a resident of the state attending as a party or a witness in a county other than that in which he lives is not exempt from the *330service of a summons in a civil action. Frisbie v. Young, 11 Hun, 474; Hopkins v. Coburn, 1 Wend. 292; Bours v. Tuckerman, 7 Johns. 538; Sheldon v. Wakely, 3 N. Y. Law Bul. 94; Flechter v. Franko, (Com. Pl. N. Y.) 15 N. Y. Supp. 674. In the case of Sheldon v. Wakely,. supra, although the action was commenced in the New York common pleas, a local court, under the provisions of section 278 of the Civil Code, the summons, though served in the city of New York,, could have been served as well on the defendant in his own county,, or any other part of the state, and the denial of the motion to set aside the summons seems to have been placed upon that ground. In the other authorities above cited the facts were similar. The-defendants in each case, although served out of the counties where they resided, and while in attendance at court as a party or witness, could have been as well served at their several homes, or anywhere within the state. This case is different Defendant, while-out of his county, in attendance as a party in an action pending in-the supreme court, in Montgomery county, was served with a summons issued by a justice’s court of the latter county. Brocessfrom that court could not have been served upon the defendant in the county where he resided. Hence, for the same reason that prevents a valid service of a summons on a nonresident of the state-while here as a witness or party, the service upon defendant of the summons issued by the justice should not be deemed authorized.. The defendant, when served, was, as to the justice’s court of Montgomery county, without the jurisdiction of his residence for the purpose of attending court in another jurisdiction. See Parker v. Marco, 136 N. Y. 585-589, 32 N. E. 989. It was stated by Allen, J., in Person v. Grier, supra, that it was at least doubtful whether any distinction lies as to the service of process between cases of nonresidents of the state attending court as parties or witnesses and persons living within the state attending in counties outside of their residences. The learned judge uses this language:
“Whether any distinction should or does in fact exist is at least doubtful'.. This immunity is one of the necessities of the administration of justice, and' courts would often be embarrassed if suitors or witnesses, while attending court, could be molested with process. Witnesses might be deterred, and parties prevented from attending, and delays might ensue, or injustice be done.”
See, also, Thorp v. Adams, (Sup.) 11 N. Y. Supp. 479.
Within the principle stated in Person v. Grier, supra, we think that a party attending an action on trial at a circuit in a county outside of his residence is exempt from the service of process in a justice’s court action in the latter county. See Pritsch v. Schlicht, 5 N. Y. St. Rep. 871; Miles v. McCullough, 1 Bin. 77. We also think that the writ of prohibition was properly issued. The relator had no other adequate remedy. He could not properly move before the justice to set aside the service of the summons. Unless'the writ had been issued, defendant would have -been compelled to proceed with the trial before the justice. See Fiero, Spec. Proc. 89-94, and cases cited. Appo v. People, 20 N. Y. 540. The order should be affirmed, with costs. All concur.