The visitors fought back until Scotland pulled away.