An oil separating mechanism (22) to be attached to a cylinder block (2) having a concave portion includes a cover member (30) for forming a closed space; a partition wall (31) for dividing the closed space into an inner chamber and an outer chamber; a dividing wall (53) for dividing the inner chamber into a first inner chamber (54) and a second inner chamber (55); a gas inlet (29) for introducing gas into the first inner chamber; a gas outlet (45) for discharging the gas; a first gas port (58) for communicating the first inner chamber with the outer chamber; and a second gas port (59) for communicating the outer chamber with the second inner chamber. The gas introduced into the first inner chamber (54) flows from the first inner chamber to the outer chamber (49). Then, the gas flowing from the outer chamber to the second inner chamber (55) is discharged through the gas outlet. <IMAGE>