An open boundary condition is constructed for three dimensional primitive equation ocean circulation models. The boundary condition utilises dominant balances in the governing equations to assist calculations of variables at the boundary. The boundary condition can be used in two forms. Firstly as a passive one in which there is no forcing at the boundary and phenomena generated within the domain of interest can propagate outwards without distorting the interior. Secondly as an active condition where a model is forced by the boundary condition. Three simple idealised tests are performed to verify the open boundary condition, (1) a passive condition to test the outflow of free Kelvin waves, (2) an active condition during the spin up phase of an ocean, (3) finally an example of the use of the condition in a tropical ocean.