SACRAMENTO -- The rigorous training at the California Highway Patrol Academy includes a ceremony, polishing a memorial to officers killed on duty.

"It puts in a little bit more perspective of what you're signing up for even before you even graduate," said Officer Edwin Lopez.

He still can't quite believe he graduated, let alone with a special commendation. "Sometimes I wake up and I'm like oh my goodness I'm an officer," Lopez said.

Long before he could get into a patrol car, Lopez had to pass a background check and lie detector test, which had him particularly worried. The Highway Patrol wants to know everywhere candidates have ever lived.

He was homeless -- and reluctant to admit that for nearly a year he lived in a Sacramento park.

He said it can be "definitely" embarassing to admit, "especially when you're during the time."

After serving in the Army, Lopez worked in a tire store but lost his job when it closed.

"I was one paycheck away and that's what happened," Lopez said. "I lost my apartment. Soon after that, I lost my car and then from there I didn't have any other place to really go."

Soon he was scrounging for food.

"You know you'd be surprised how much food people throw away, you know," Lopez said. "If it was in the dumpster and it wasn't molded or something like that it was good enough for me."

Lopez was still serving in the Army National Guard that paid $150 a month, which he spent $50 keeping his cell phone going so he could look for work.

"I always thought like, 'I'm going to make it out of this,'" Lopez said. "And when I get out of it, I'm going to be able to say that I learned something from it rather than just rolled over and took it and just waited for someone to save me you know."

The California Highway Patrol decided his experience on the streets could be an asset for an officer. Now Officer Edwin Lopez has a uniform, a fiancée and a home -- and he's thankful for all of it.