Exclusive Details

Kim Kardashian West is making sure one man recently released from jail will have a roof over his head for the next 5 years -- she's picking up his rent bills -- TMZ has confirmed.

Matthew Charles -- who had served 20 of his 35-year sentence for a non-violent drug and weapons charges -- was the first to be released under new prison reform laws. Charles recently had his housing application denied because of his background.

Sources familiar with the situation tell us Kardashian heard about Charles' story and wanted to do what she could to help ... so she's going to pay his rent for the next 5 years.

Kim first heard of Charles' story through an article posted on Twitter -- Charles was first granted early release in May 2016 by mistake -- and two years later was ordered to finish out the rest of his sentence. Charles was able to start to get back on his feet by purchasing a vehicle and staying with friends ... but had a hard time landing a place to live.

We're told Kim reached out to Charles and his friend privately Sunday and generously offered to pay his rent and to help him find a stable place to live.

Charles posted about the good news Sunday, saying, "I just received the most wonderful news tonight that I just had to share with everyone. Kim Kardashian-West heard about my situation. Was moved and has decided to help me."