An Australian national can stay in the United States because a federal appeals court ruled Monday that he cannot be punished for his attorney’s incorrect advice about a crime not being a deportable offense.

The U.S. Court of Appeals for the Second Circuit said Stephen Kovacs, a permanent U.S. resident since 1977, wouldn’t have entered a guilty plea in an insurance wire fraud case had he known that one day immigration officials would bar him from the United States.