The pair, first spotted early in the morning, came close to the harbour walls and swam behind small vessels.
Resident Madeleine Santonna said: "I've lived by the harbour all my life and I've never seen anything like it."
The Sea Watch Foundation said they were common dolphins, a breed which usually gathers in large groups offshore in deep waters.
Peter Evans from the marine charity said: "Although they are called 'common' they don't normally come into harbours.
"We don't know why individual dolphins come into such inshore areas, often surrounded by boats. Sometimes it is because one is sick or injured and its companion wants to remain close by it."
Mrs Santonna said the sighting caused "huge excitement" with hundreds of people lining the harbour to catch a glimpse of the dolphins.
She said: "They were interacting with people, swimming up and down and round and round and seemed to be enjoying themselves."
The Maritime and Coastguard said it had received several calls from members of the public who had spotted the dolphins.
The agency said the Wyke Regis coastguard team was sent to the harbour to observe the pair, which were thought to have since headed back out to sea.
It said The British Divers Marine Life Rescue unit had also been alerted in case the dolphins returned.
A pair of dolphins have made their way into Weymouth Harbour where they were watched by crowds of people.