Preheat the oven to 350°F (175°C).
Prepare the sweet potatoes by peeling and boiling them until soft. Drain and mash until smooth.
In a large mixing bowl, combine the mashed sweet potatoes, sugar, milk, melted butter, eggs, vanilla, cinnamon, and nutmeg.
Pour the sweet potato mixture into a greased baking dish and smooth the top with a spatula.
Bake in the preheated oven for 25 minutes or until slightly set.
While the casserole is baking, prepare the topping by mixing melted butter with marshmallows and chopped pecans in a separate bowl.
After 25 minutes, remove the casserole from the oven and spread the marshmallow-pecan mixture evenly over the top.
Return the casserole to the oven and bake for an additional 10-15 minutes, or until the marshmallows are golden and toasty.
Remove from the oven and let it cool for a few minutes before serving.