The epic Ramayans narrates how their first encounter took place. When Lord Rama and Lakshmana were wandering in the forests of Kishkindha searching for Sita, Sugreeva and Hanuman had a chance meeting with them.
At first Sugreeva was suspicious about the strangers, but Hanuman assured him that they were not friends of Vali or spies sent against him. They seemed to be very respectable and dignified warriors and harmless. With Sugreeva's half-hearted permission, he approached the strangers in the guise of a brahmana and made enquires about the purpose of their visit.
Lord Rama was mighty pleased when he saw Hanuman and was impressed by his impeccable manners, his refined language, his innocence and his simple trusting heart. He instantly recognized in him the qualities of a perfect messenger whom he could himself trust and rely upon when the time came. Thus began a relationship between god and his devotee which is spoken about even today as the perfect example of highest form of devotion and self-surrender.