A sample processing apparatus comprising an agitating means for agitating a sample in a sample tube (101; 103); a processing means for processing the agitated sample; a controlling means for controlling at least the agitating operation; and an identifying means for identifying a type of a sample tube (101; 103); wherein the controlling means is configured to control the agitating means according to the type of sample tube (101; 103), to agitate a sample in a first type of sample tube under a first agitation condition, and to control the agitating means to agitate a sample in a second type of sample tube , which contains a sample of lower volume than the first type of sample tube, under a second agitation condition different from the first agitation condition; the first type of sample tube differs from the second type of sample tube in structure or shape, and the identifying means is configured to identify the type of sample tube on the basis of difference in structure or shape between the first and second types of sample tubes (101; 103); the agitating means is configured to move a sample tube between an overturned state where a bottom is positioned higher than a lid of the sample tube (101; 103) and an upright state where the lid is positioned higher than the bottom; and the controlling means is configured to control the agitating means to repeat a cycle in which a sample tube (101; 103) switches its state between the overturned state and the upright state at least twice, for a plurality of cycles; characterized in that : the second agitation condition includes stopping the sample tube (101; 103) for a predetermined period of time in the overturned state, and stopping the sample tube (101; 103) for a predetermined period of time in the upright state. an agitating means for agitating a sample in a sample tube (101; 103); a processing means for processing the agitated sample; a controlling means for controlling at least the agitating operation; and an identifying means for identifying a type of a sample tube (101; 103); wherein the controlling means is configured to control the agitating means according to the type of sample tube (101; 103), to agitate a sample in a first type of sample tube under a first agitation condition, and to control the agitating means to agitate a sample in a second type of sample tube , which contains a sample of lower volume than the first type of sample tube, under a second agitation condition different from the first agitation condition; the first type of sample tube differs from the second type of sample tube in structure or shape, and the identifying means is configured to identify the type of sample tube on the basis of difference in structure or shape between the first and second types of sample tubes (101; 103); the agitating means is configured to move a sample tube between an overturned state where a bottom is positioned higher than a lid of the sample tube (101; 103) and an upright state where the lid is positioned higher than the bottom; and the controlling means is configured to control the agitating means to repeat a cycle in which a sample tube (101; 103) switches its state between the overturned state and the upright state at least twice, for a plurality of cycles; characterized in that : the second agitation condition includes stopping the sample tube (101; 103) for a predetermined period of time in the overturned state, and stopping the sample tube (101; 103) for a predetermined period of time in the upright state. <EOS>