Update at 2:49 p.m. ET: Rahm Emanuel says he will appeal a court ruling that he is ineligible to run for mayor in the Feb. 22 elections and believes that he will prevail.

"I have no doubt at the end we will prevail," Emanuel told reporters. "As my father has said, nothing is ever easy."

An appeals court ruled 2-1 that he did not meet the one-year residency requirement to run for mayor because he was living in Washington for the past two years as President Obama's chief of staff.

Update at 1:35 p.m. ET:An Illinois appeals court has kicked Rahm Emanuel off next month's ballot for Chicago mayor, ruling 2-1 that he does not meet the one-year residency requirement because he was living in Washington for the past two years as President Obama's chief of staff.

Read the ruling below or here.

A lawyer for Emanuel says he intends to appeal the ruling to the Illinois supreme court, the Associated Press reports.

It was the first reversal for Emanuel in his mayoral bid. The Chicago Board of Election Commissioners and a Cook County judge have both ruled in favor of the former congressman, the AP says.

The appeals court, however, noted that the former Democratic congressman had rented out his Chicago home and moved his family to Washington during his stint at the White House.

The election is Feb. 22. He can appeal the ruling to the state supreme court.

Earlier posting: An appeals court has overturned a residency decision for Rahm Emanuel, ruling that he is ineligible to run for mayor of Chicago, the Chicago News Cooperative reports.

The state court ruled that he is not a resident of Chicago. Emanuel did not live in the city while serving as President Obama's chief of staff.

CNC reports that the court said in it ruling:

We conclude that the candidate neither meets the the municipal code's requirement that he have 'resided' in Chicago for the year preceding the election in which he seeks to participate nor falls within any exception to the requirement.

Update at 1:24 p.m. ET: The election is scheduled for Feb. 22. The Chicago Sun-Times reports that the appellate panel ruled 2-1 against Emanuel. The newspaper quotes Emanuel's attorney, Kevin Forde, as saying, "It's a surprise." The Sun-Times adds that Emanuel is expected to appeal the case to the Illinois Supreme Court.