A Newport man accused of raping a child will spend three years in prison after pleading guilty to a lesser charge.