We present performance results of the final prototype for the CASTOR quartz-tungsten sampling calorimeter, to be installed in the very forward region of the CMS experiment at the LHC. The energy linearity and resolution, the uniformity, as well as the spatial resolution of the prototype to electromagnetic and hadronic showers are studied with $E=$ 10--200 GeV electrons, $E=$ 20--350 GeV pions, and $E=$ 50, 150 GeV muons in beam tests carried out at CERN/SPS in 2007.