South and North Korean boats have exchanged naval fire after a patrol boat from the North crossed the disputed sea border, a South Korean defence official said.

The defence ministry said the South's patrol boat had initially fired a warning shot after the North Korean vessel penetrated half a nautical mile inside the South's territorial waters.

Instead of retreating immediately, the North patrol boat opened fire, so "our side fired back," a ministry spokesman said, adding there was "no damage" sustained by the South Korean vessel.

Although the incident went beyond warning shots, the spokesman indicated that neither side had made a concerted effort to hit the other.

There were no casualties on the South Korean side and none of the shots by either side was aimed at the other's vessel, a South Korean defence official told Reuters.

The incident comes as a surprise visit of a top-ranking North Korean delegation to the South just three days before had raised hopes of a constructive reboot in strained inter-Korean relations.

They agreed to resume dialogue on improving ties that had been cut off in February, raising hope for a breakthrough in the relationship between the rivals.

The area has been the scene of clashes in the past that killed scores of sailors on both sides, with North Korean vessels frequently crossing the Northern Limit Line near Yeonpyeong, which it refuses to recognise as a maritime border.

AFP/Reuters