Late, brief answer: it was controversial through his lifetime and for several decades after his death was considered probably not correct by many scientists. They did not doubt evolution (he was given credit for convincing them of that), they doubted that natural selection and gradualism could account for it. There were deep rifts in the community of biologists between those who took a more statistical approach, those who believed in non-gradual mutations, and those who were "neo-Darwinians." Tensions were further increased by the "re-discovery" of Mendelian heredity, which did not seem to mesh with Darwin's work very well.
The "consensus" emerged only with the development of the modern evolutionary synthesis in the 1920s-1930s. This essentially involved the merging of evolutionary theory with new insights from population genetics, and showed how all of the previous ideas (Mendelism, gradualism, statistical biology, mutation, natural selection) could all be made to work together in a very elegant Darwinian framework. At that point Darwinian natural selection as the motive force of evolution became essentially consensus for biologists. Again, this is not the same thing as saying that evolution was not a consensus; this became a consensus among biologists essentially after Darwin (the "next generation" of scientists did not doubt it, on the whole). It is a question specifically about the mechanism.
For more information and detail, especially about the much-neglected "Eclipse of Darwinism," that followed prior to the modern synthesis, see Bowler, Evolution: The History of an Idea.