putting a game object in a object field

I am trying to put a game Object in my custom object field but it gives me the error
InvalidCastException: Cannot cast from source type to destination type.
The code looks like this:

Object prefab = prefabs[t];

prefabs[t] = (GameObject)EditorGUI.ObjectField(new Rect(fieldX,fieldY,position.width,20),
                                              t.ToString(),prefab,typeof(Object),true);
fieldY + = 20;
if(prefabs[t] != null)
    EditorGUI.LabelField(new Rect(0,fieldY,position.width,20),prefabs[t].name);

I am using C#.

Don’t deal with Object, replace it with GameObject. For the type of prefab and inside ObjectField parameters.

Maybe you should use as GameObject instead of (GameObject), but I’m not on solid ground on the difference between those two.