A judge on Tuesday ordered Dauphin County sheriff's deputies to visit all city polling stations and seize raffle tickets that offered the chance to win cash or an iPhoneX for voting in the Harrisburg's mayor's race.

The emergency injunction granted by Common Pleas Judge Scott Evans just before 1 p.m. ordered deputies to begin the seizures at following wards: 5, 4, 10, 11, 12, 13 and 14. After that, the deputies would visit other wards and return to any polling station if there is evidence that raffle tickets have resurfaced.

The court found that the raffle ticket is "promoting of a particular race and suggestive of balloting. Therefore, the Deputy Sheriffs of Dauphin County are directed to go to ALL city precincts polling locations and seize any and all raffle tickets."

The judge's order also directed the deputies "to keep record of what was seized as well as obtain and record the name of the individual in possession of the item(s) seized. The sheriffs are further authorized to photograph any individuals who refuse to provide their identity."

The backside of the fliers distributed Monday in Harrisburg.

The injunction was "prompted by a voter filing," according to Amy Richards, the Dauphin County spokeswoman.

Fliers promoting the raffle were distributed to homes in uptown Monday, along with fliers promoting Gloria Martin-Roberts, according to Pierre MaCoy, who found two fliers tucked into his door. His neighbor got the same two fliers, he said.

One flier encouraged residents to show up at their polling station by offering the chance to win the newly released iPhone as first prize, $500 cash as second prize and a $200 gift card to Best Buy as the third prize. "Free entry to raffle if you vote for Harrisburg mayor," the flier said.

On the back, the flier listed two candidates in the mayor's race: Incumbent Mayor Eric Papenfuse and Gloria Martin-Roberts, who on Nov. 3 renewed a write-in campaign for mayor.

Lewis Butts, another candidate who lost to Papenfuse in the primary, also launched a write-in campaign for mayor but his name was not listed on the raffle flier.

It was unclear who is behind the raffle because no candidate or political action group was listed. Instead, the flier was intentionally vague and referenced a Facebook page created on Nov. 3 called "Harrisburg Mayoral Election 2017." The winners were supposed to be announced on the page at noon on Nov. 9.

No one was listed as the administrator for the Facebook page and no one immediately responded to an inbox message.

But one man providing raffle tickets at Ward 6 said he was approached at the Bethesda Mission men's homeless shelter by a lawyer who told him it was legal to provide the tickets as long as he didn't say which candidate to vote for.

The second flier distributed with the raffle announcement encouraged residents to write in Gloria Martin-Roberts for mayor. Papenfuse beat Martin-Roberts and four other challengers in the Democratic primary in May.

Papenfuse also beat Martin-Roberts in a write-in election in May in the Republican primary, so his name appears as the nominee for both parties.

Martin-Roberts could not be reached Tuesday about the fliers.

Papenfuse said he spoke to several of the people handing out raffle tickets at the polls Tuesday and they told him they were referred by the Martin-Roberts' campaign. One raffle ticket distributor identified a photo of attorney James Ellison as the person who recruited him, Papenfuse said. Ellison was the campaign manager for Martin-Roberts.

"I condemn this clear attempt to violate election law," he said.

Dauphin County First Assistant District Attorney Fran Chardo said his office was investigating the raffle.

Richards said this is the section of election law pertaining to the raffle:

"Any person who shall, directly or indirectly, give or promise or offer to give any gift or reward in money, goods or other valuable thing to any person, with intent to induce him to vote or refrain from voting for any particular candidate or candidates or for or against any constitutional amendment or other question at any primary or election; or who shall, directly or indirectly, procure for or offer or promise to procure for such person any such gift or reward with the intent aforesaid; or, who with the intent to influence or intimidate such person to give his vote or to refrain from giving his vote for any particular candidate or candidates or for or against any constitutional amendment or other question at any primary or election, shall give to or obtain for or assist in obtaining for or offer or promise to give to or obtain for or assist in obtaining for such person any office, place, appointment or employment, public or private, or threaten such person with dismissal or discharge from any office, place, appointment or employment, public or private, then held by him, shall be guilty of a felony of the third degree, and, upon conviction thereof, shall be sentenced to pay a fine not exceeding fifteen thousand ($15,000) dollars, or to undergo an imprisonment of not more than seven (7) years, or both, in the discretion of the court."

UPDATED:This article was updated to include comments from Papenfuse.