In 1861 , the Dominicans voluntarily returned to the Spanish Empire , but two years later they launched a war that restored independence in 1865 .