A federal judge in Brooklyn has granted a petition for a writ of habeas corpus filed by a man sentenced nine years ago to 25 years in prison for sexually abusing a 4-year-old girl.

Eastern District Judge Nicholas G. Garaufis held that the defendant’s trial counsel provided ineffective assistance by, among several other shortcomings, failing to sufficiently challenge the “relatively weak” physical evidence.