Sir Alfred John Ainley, MC (10 May 1906 – 19 January 1992) was a British colonial judge.
He was born in England and educated at St Bees School, Cumbria and Corpus Christi, Oxford.
He became a Magistrate in the Gold Coast in 1935. During the second World War he served as a Lieutenant in the Gold Coast Regiment, active in the African theatre, and was awarded the Military Cross in 1941. After the war he was appointed a Puisne Judge in Uganda (1945 to 1955), before spending a term as Chief Justice of the Eastern Region of Nigeria. He was knighted for his services in 1957.
In 1959 he was appointed Chief Justice of the United Judiciary of Sarawak, North Borneo and Brunei but then transferred back to Africa in 1963 to be Chief Justice of Kenya just prior to Kenyan independence in 1964, thereby becoming the first Chief Justice of the independent country.
During his time in Kenya he was notable for sentencing Kisilu Mutua to death for conspiring in the murder of Pio Gama Pinto, a journalist and freedom fighter. The sentence was later commuted to 35 years imprisonment.
He retired in 1968 and moved to live with his wife Mona Sybil in Watermillock, Cumbria.