The Royal Burgh of Dunfermline (in Gaelic, Dùn Phà rlain) is a town in Fife, Scotland. It sits on high ground 3 miles from the shore of the Firth of Forth, northwest of Edinburgh. The town is the historic capital of Scotland and Robert the Bruce is buried within Dunfermline Abbey.