A former Sunshine Coast man was "distressed and upset" when he found out the man he raped had HIV.

Phillip Donald Jason's first sexual encounter with another man started off as consensual sex but led to him "crossing a line" and being charged with rape, Brisbane District Court heard.

The 48-year-old man was "distressed and upset" when he found out the man he raped had HIV.

The victim asked him to stop, but he did not stop straight away.

Later, after being arrested, Jason, 48, was told his victim was HIV positive.

"He was first made aware of that after he was arrested … and he was obviously distressed and upset," his defence lawyer Andrew O'Brien told the court on Wednesday.

Read more at the Sunshine Coast Daily.