The "Ave Maria" most commonly known in classical music was written by Austrian composer Franz Schubert in 1825. It is originally titled "Ellens Gesang III" (Ellen's Third Song) and was part of a set of seven songs based on Sir Walter Scott's poem "The Lady of the Lake." Schubert's composition was not initially intended as a setting of the Catholic prayer "Ave Maria," but the opening words and its melodic beauty led to it becoming widely associated with that prayer.
There is also another famous "Ave Maria" composed by Charles Gounod, who in 1853 superimposed a melody over a prelude by Johann Sebastian Bach. This version is separate from Schubert's and has become popular as well.
In summary, Franz Schubert wrote the most famous "Ave Maria" setting in 1825, originally part of a song cycle based on Walter Scott's poem.