Did slaves build the Egyptian pyramids?

According to some ancient sources, the kings of ancient Egypt used large numbers of slave labour to undertake large building projects, such as the pyramids. Is there any truth to this notion?