A man who crept into a Portland home and hit a sleeping 6-year-old girl with a frying pan has been sentenced to at least seven years in a state mental hospital.

Michael Jerard Parker agreed to the major facts in the case against him Monday and the Multnomah County Circuit Court judge found him guilty of assault and robbery except for insanity.

The Oregonian reports the 29-year-old will be under the watch of the Psychiatric Security Review Board for 30 years.

Police say Parker entered the home in June of 2011, hit the girl with a cast iron frying pan as she slept and also hit her father in a fight. The family didn't know the girl was injured until she awoke with a headache.