A man accused of raping a 13-year-old boy he met online in the front yard of the boy's Sydney home has been confronted by angry residents after facing court.

Moud Ul Hasan Nuri, 40, appeared at Penrith Local Court today over the alleged sexual assault and attempted to make a quick getaway before being met with a vocal crowd of people who had been passing by as he left court.

It is not believed the group have any connection to the alleged victim.

A 40-year-old man accused of raping a teenager he met online before stalking him to the front yard of his home today appeared at Penrith Local Court. (AAP)

NSW Police allege the man met the teenager through social media on September 28 and began talking to him, exchanging pictures and personal details before planning to meet in person.

It is understood the boy then deleted the app.

At about 6.45pm on the same day, police allege the man went to the boy’s home and approached him while he was in the front yard, before pushing him to the ground and sexually assaulting him.

Moud Nuri was arrested after police conducted a search warrant at a home in Kellyville Ridge, in Sydney's north-west, and charged him with sexual intercourse without consent. (AAP)

The alleged attack was only stopped when the boy’s mother rushed to his aid and the man ran to his car and fled the scene.

The teenager was taken to The Children’s Hospital at Westmead, and police conducted a search warrant at a home in Kellyville Ridge on Sunday before the man was arrested.

After his court appearance today, Nuri was confronted by a group of angry people. (9NEWS)

Nuri was granted strict conditional bail prior to his court appearance today. (9NEWS)

He has since been charged with sexual intercourse without consent and was granted strict conditional bail in Parramatta Bail Court on Monday, before his court appearance today.