Lorre played the role of Joel Cairo in the movie The Maltese Falcon ( 1941 ) and played the role of `` Ugarte '' in the movie Casablanca ( 1942 ) . Lorre played the role of Joel Cairo in The Maltese Falcon ( 1941 ) and portrayed the character Ugarte in the film classic Casablanca ( 1942 ) .