After visiting for a while, he suddenly stood up and said goodbye.

Literal

Come-to-visit-[after-てから] a-while, he [topic-は] suddenly stood-up-[sequential-て] parting [object-を] announced

Two linkers in one sentence. ~てから means 'after doing X'; here 訪ねてきてしばらくしてから stacks the idiom しばらくする ('to spend a while') into the whole — 'after having come to visit and spent a while'. 別れを告げる is a stock phrase for formally announcing a farewell.