An adverb meaning 'of course' or 'certainly', used to indicate agreement or to affirm something (usually written in kana).
明日は早く来てくださいね。— もちろん、了解しました。
Please come early tomorrow. — Of course, got it.
彼が来るのはもちろんだが、準備も必要だ。
It's natural that he'll come, but preparations are also necessary.
この計画は問題がない、もちろん上司の承認が必要だ。
There are no problems with this plan; of course, we need the boss's approval.