In the sentence "A long time ago, there lived a beautiful princess," what part of speech is the word "ago"?

"a long time ago" is an adverb phrase telling when.

To determine the part of speech of a word, we need to consider its function in the sentence. In the sentence "A long time ago, there lived a beautiful princess," the word "ago" modifies the noun phrase "a long time." It expresses a specific point in the past. Therefore, "ago" is functioning as an adverb in this sentence.

To identify the part of speech of a word, you can follow these steps:
1. Determine the word's function in the sentence.
2. Identify any modifiers or qualifiers (e.g., adjectives, adverbs) that describe the word.
3. Consult a reliable dictionary or grammar resource for further clarification, as some words can have multiple functions or be part of different word classes depending on the context.

I believe it acts as an adjective describing the word "time." If the structure of the sentence is changed to:

Long ago, there lived a princess.

I think then it would be an adverb describing "lived."

I would wait for further confirmation on that from someone else, but that's my initial thought.