One of the regular functions of と
in Japanese is as a quotation particle. This use is called 引用（いんよう） in Japanese, which basically translates as ‘reference’, or ‘citation’. This way of using と
can appear after almost any type of word (or phrase), but requires だ
when used after nouns or な-Adjectives
The teacher yelled, ‘Watch out!’
Kimura san said, ‘I walked 3 km.’
I think that is a cat.
Do you think that Mt. Fuji is beautiful?
as a quotation marker will almost always be followed by a verb that shows what type of ‘quote’ it is. This can be words like 言（い）う, 思（おも）う, 考（かんが）える, 聞（き）く, etc. However, at the end of a sentence, the verb will often be omitted.
As with other instances of the particle と
being used, this use simply expresses the relationship between (A) ‘what was communicated’, and (B) ‘how it was communicated’.