Two years ago.
It happened ages ago.
An example of ago used as an adjective is in the phrase "days ago."
An example of ago used as an adverb is in the phrase "long ago."
Origin of ago
- Middle English past participle of agon to go away from Old English āgān ā- intensive pref. gān to go ghē- in Indo-European roots
From American Heritage Dictionary of the English Language, 5th Edition